首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Programming Ruby(璇讳功绗旇)-七绔?姝e垯)

2014-01-08 
Programming Ruby(璇讳功绗旇)-7绔?姝e垯)聽涓嶅尮閰嶈繑鍥瀗il锛屽悓鏍峰彲浣滀负if while鐨勬潯浠?/p

Programming Ruby(璇讳功绗旇)-7绔?姝e垯)

聽涓嶅尮閰嶈繑鍥瀗il锛屽悓鏍峰彲浣滀负if while鐨勬潯浠?/p>

Change Strings with Patterns
a = 'see [The PickAxe-page 123]'show_regexp(a, /[A-F]/)        # => see [The Pick->A<-xe-page 123]show_regexp(a, /[A-Fa-f]/)    # => s->e<-e [The PickAxe-page 123]show_regexp(a, /[0-9]/)        # => see [The PickAxe-page ->1<-23]show_regexp(a, /[0-9][0-9]/) # => see [The PickAxe-page ->12<-3][^...]鍙栭潪show_regexp('Price $12.', /[^A-Z]/) # => P->r<-ice $12.show_regexp('Price $12.', /[^\w]/) # => Price-> <-$12.show_regexp('Price $12.', /[a-z][^a-z]/) # => Pric->e <-$12.show_regexp('It costs $12.', /\s/) # => It-> <-costs $12.show_regexp('It costs $12.', /\d/) # => It costs $->1<-2.

聽---------------------------------姝e垯寮忓埌姝わ紝濡傛灉鏈夋椂闂村悗闈㈠啀缁?----------------------

热点排行