J
Jedrin
I wonder if there is an easier way to do this. State here is going
to be two characters,
it can be preceded by space, or comma and followed by period, end of
string, or space.
Also, if this can be done with an SQL select like pattern please let
me know
pat = /\s{state.to_s.upcase}\s/
pat2 = /\s{state.to_s.upcase}$/
pat3 = /,{state.to_s.upcase}$/
pat4 = /,{state.to_s.upcase}\s/
pat5 = /,{state.to_s.upcase}\./
pat6 = /\s{state.to_s.upcase}\./
if pat.match(station.description) or
pat2.match(station.description) or
pat3.match(station.description) or
pat4.match(station.description) or
pat5.match(station.description) or
pat6.match(station.description)
to be two characters,
it can be preceded by space, or comma and followed by period, end of
string, or space.
Also, if this can be done with an SQL select like pattern please let
me know
pat = /\s{state.to_s.upcase}\s/
pat2 = /\s{state.to_s.upcase}$/
pat3 = /,{state.to_s.upcase}$/
pat4 = /,{state.to_s.upcase}\s/
pat5 = /,{state.to_s.upcase}\./
pat6 = /\s{state.to_s.upcase}\./
if pat.match(station.description) or
pat2.match(station.description) or
pat3.match(station.description) or
pat4.match(station.description) or
pat5.match(station.description) or
pat6.match(station.description)