Programming Ruby(璇讳功绗)-7绔?姝e)
涓il锛峰浣负if while浠?/p>
Change Strings with Patternsa = '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寮姝わ濡村㈠缁?----------------------