amitk / Coorporatecatering

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

assignment operator in regex #1

Open amitk opened 7 years ago

amitk commented 7 years ago

=begin

=~ This pattern-matching operator operator returns index of first match in string, otherwise it returns nil.

=end

p /hey/ =~ 'heywassup'

p /hellp/ =~ 'heywassup'