amitk / Coorporatecatering

A ruby on rails learning project
0 stars 0 forks source link

metacharacter in ruby #5

Open amitk opened 7 years ago

amitk commented 7 years ago

=begin Meta Characters 12 character ( ) , [ ] , { } , . , ? . + , , ^ , $ To match escape with \ () used for capturing & grouping [] used as delimiter for character class {} used to specify interval , ? , + , are quantifiers ^ Start with $ Ends with =end

p /1 + 2 = 3\?/.match('Does 1 + 2 = 3?')

p /(a+b)/.match("(a+b)")