读书人

Programming Ruby(璇讳功绗)-七绔

发布时间: 2014-01-08 00:30:58 作者: rapoo

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寮姝わ濡村㈠缁?----------------------

读书人网 >编程

热点推荐