Skip to content

Commit

Permalink
CFE-2850: Fixed wrong explanation of trivial option in regex_replace
Browse files Browse the repository at this point in the history
The documentation previously claimed that the trivial option `T'
disabled searching for regex patterns, only searching for exact
strings. What it is supposed to do, as per what PCRE defines, is
remove backreferences and special characters in the replacement
string.

Ticket: CFE-2850
Changelog: Title
(cherry picked from commit 2fbd532)
  • Loading branch information
karlhto authored and nickanderson committed Jul 18, 2018
1 parent 035e00a commit c2c9fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reference/functions/regex_replace.markdown
Expand Up @@ -21,7 +21,7 @@ inside the regular expression, e.g. `(?s)`.
* `s`: dot matches newlines too (`PCRE_DOTALL`)
* `x`: extended regular expressions (`PCRE_EXTENDED`, very nice for readability)
* `U`: ungreedy (`PCRE_UNGREEDY`)
* `T`: this is not a regular expression, just replace the exact string
* `T`: disables special characters and backreferences in the replacement string

In the replacement, `$1` and `\1` refer to the first capture group.
`$2` and `\2` refer to the second, and so on, except there is no `\10`
Expand Down

0 comments on commit c2c9fa5

Please sign in to comment.