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垯寮忓埌姝わ紝濡傛灉鏈夋椂闂村悗闈㈠啀缁?----------------------
聽
聽
聽
聽
聽