Skip to content

Comment on Stop avoiding regular expressions damn itparent

Comments

Many programming languages have a function for that to do that for you...

In Perl, it's called quotemeta (qw, qq and family, too), in Python and Ruby it's .escape... and there's always \Q ... \E to use...

I'm sure others have similar methods/functions.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.