Ruby语言文摘:在正则表达式中最复杂重复限定符{m,n}

Posted by cnruby Sat, 05 Aug 2006 11:30:00 GMT

Ruby语言文摘:在正则表达式中最复杂重复限定符{m,n}

  • 文摘
    The most complicated repeated qualifier is {m,n}, where m and n are decimal integers. This qualifier means there must be at least m repetitions, and at most n. For example, a/{1,3}b will match "a/b", "a//b", and "a///b". It won't match "ab", which has no slashes, or "a////b", which has four.



________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in  | Tags ,  | no comments | no trackbacks

看图学习Ruby语言:通过正则表达式替换字符串gsub

Posted by cnruby Sat, 27 May 2006 07:38:00 GMT

看图学习Ruby语言:通过正则表达式替换字符串gsub

看看问题图,想想输出图:

 

正则表达式基础:http://rubycn.ce-lab.net/20020314.html


________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in  | Tags , ,  | no comments | no trackbacks