stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

Add `regex.escape`

Open apainintheneck opened this issue 1 year ago • 2 comments
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:

apainintheneck avatar Aug 14 '24 03:08 apainintheneck