Method regexp.escapeQE
Overload
Encloses string in \Q \E if it contains metacharacters \^$.[|()?*+{ or if always == true.
public static string escapeQE(string s, bool always = false)
Parameters
|
s (string)
Can be |
|
always (bool)
Enclose always, even if the string does not contain metacharacters. Should be |
Returns
Remarks
Such enclosed substring in a regular expression is interpreted as a literal string.
This function also escapes \E, so that it does not end the literal string.