Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape regex metacharacters in substitution string #45

Closed
wants to merge 1 commit into from
Closed

Conversation

ahupp
Copy link
Contributor

@ahupp ahupp commented Oct 7, 2023

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 facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 7, 2023
  `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
Copy link
Contributor

@swolchok swolchok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@swolchok merged this pull request in 8070231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants