r-lib / rex

Friendly regular expressions for R.
https://rex.r-lib.org
Other
334 stars 27 forks source link

Escaping special characters #6

Closed jimhester closed 10 years ago

jimhester commented 10 years ago

we currently don't do any escaping of special characters, probably will want to to avoid confusion.

jimhester commented 10 years ago
ESCAPED_CHARS = c('*', '.', '?', '^', '+', '$', '|', '(', ')', '[', ']', '{', '}')
gsub(p('([\\', p(collapse='\\', ESCAPED_CHARS),'])'), '\\\\\\1', p, perl=TRUE)

Is how I did it before...

jimhester commented 10 years ago

Fixed by d65174be