Regex in Ruby

转载 2013年12月01日 22:07:04

Code is as follows:

if

"405511107@qq.com".match(/^([a-z0-9A-Z]+[-|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/)
puts "Email address 405511107\@qq.com matches regex of email address"
else
puts "Email address 405511107\@qq.com doesn't match regex of email address"

end


Executed Result:

Email address 405511107@qq.com matches regex of email address

regex in SearchEverything

SearchEverythingUse the search edit to type in a search.Everything will display the results immediat...
  • tlaff
  • tlaff
  • 2016年11月01日 10:13
  • 325

Characters in Regex expression

正则表达式(regular expression)描述了一种字符串匹配的模式,可以用来检查一个串是否含有某种子串、将匹配的子串做替换或者从某个串中取出符合某个条件的子串等。 列目录时, dir *....

lisa with match (regex) build in ( 1st version toward scan word)

(match  'main  'cb) (match 'printf 'cb) (match  'name  'cb)   (  match     (  quote  main   )   ...

Metaprogramming in Ruby: It’s All About the Self

Metaprogramming in Ruby: It’s All About the Self November 15th, 2009 After writing my last post on...

Understanding nil?, empty? and blank? in Ruby and Rails

When first learning Ruby and Rails, I often used the methods nil?, empty? and blank? incorrectly. Th...

How to install Ruby on Rails in Ubuntu 11.10

by Ramesh Jha on 2011/10/27   http://blog.sudobits.com/2011/10/27/how-to-install-ruby-on-rails-in-...

Pandas中兼并数组和字典功能的Series 2013-03-24 11:24:00 分类: Python/Ruby In [2]: # 这段代码用于并排显示多个Series对象 from it

Pandas中兼并数组和字典功能的Series 2013-03-24 11:24:00 分类: Python/Ruby In [2]: # 这段代码用于并...

The Safe Navigation Operator (&.) in Ruby

The most interesting addition to Ruby 2.3.0 is the Safe Navigation Operator(&.). A similar operator ...

Ruby socket programming in CloudFoundry

This part is some work of code analysis of CF. First, let's look at the ../vcap/common/lib/vcap/...
  • resouer
  • resouer
  • 2012年09月11日 15:12
  • 1440

Watir In Action —— Setup note(Watir安装/Windows XP/Chrome 17/Ruby1.9.3-p0)

1.下载最新版本的Ruby 下载地址:http://rubyforge.org/frs/?group_id=167 本次安装使用:Ruby1.9.3-p0 http://files.rubyfor...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Regex in Ruby
举报原因:
原因补充:

(最多只允许输入30个字)