stdlib
stdlib copied to clipboard
Add `regex.escape`
trafficstars
This would take a string and return a string with all regex-specific characters escaped so that it would match the literal string if compiled to a regex. It would be useful when you want to exactly match part of a string while partially matching other parts a string. I'm not sure how difficult this would be to add though because of the differences between JS and Erlang regex syntax.
fn escape(string: String) -> String
Related: