facebookincubator / fastmod

A fast partial replacement for the codemod tool
Apache License 2.0
1.66k stars 41 forks source link

Escape regex metacharacters in substitution string #45

Closed ahupp closed 9 months ago

ahupp commented 11 months ago

fastmod -F 'something' '$foo.bar'

was replacing with .bar, not $foo.bar as intended. Now it works.

Docs for replacement string escaping: https://docs.rs/regex/1.9.6/regex/struct.Regex.html#replacement-string-syntax

facebook-github-bot commented 9 months ago

@swolchok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 9 months ago

@swolchok merged this pull request in facebookincubator/fastmod@8070231e256a6432e3699109d645214269aa151e.