r-transit / gtfsio

Read and Write General Transit Feed Specification (GTFS)
https://r-transit.github.io/gtfsio/
Other
13 stars 3 forks source link

escape characters in grep expressions #16

Closed mpadge closed 3 years ago

mpadge commented 3 years ago

This is minor, but important. Characters including . and : have a special meaning in regex, and need to be specified as literal characters for R's grep to treat them as such. Without them, R will first try to interpret them as part of a regex command sequence, and if that fails (which it would here), will presume they are meant as string literals. This skips the first step, and tells R's interpreter to treat them just as literal strings.

dhersz commented 3 years ago

Great catch @mpadge! Thanks.