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

Fixes #24537: Regex in file replace line must not match the string used as replacement #1420

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tree/30_generic_methods/file_replace_lines.cf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
# Content can be captured in regular expression, and be reused with the notation `${match.1}` (for first matched
# content), `${match.2}` for second, etc, and the special captured group `${match.0}` for the whole text.
#
# **This regular expression must not match the string used as a replacement.**
# For example, to set `kernel.shmmax=5678`, the regular expression would be `kernel.shmmax=(?!5678$).*`
# and the string used as remplacement `kernel.shmmax=5678`
# Note that if you want to replace a key-value line, method `File key-value present` is more suited.
#
# #### Example
#
# Here is an example to remove enclosing specific tags
Expand Down