Escape characters in a string.
String_Type str_quote_string(String_Type str, String_Type qlis, Integer_Type quote)
The str_quote_string
returns a string identical to str
except that all characters in the set specified by the string
qlis
are escaped with the quote
character, including the
quote character itself. This function is useful for making a
string that can be used in a regular expression.
Execution of the statements
node = "Is it [the coat] really worth $100?";
tag = str_quote_string (node, "\\^$[]*.+?", '\\');
will result in tag
having the value:
Is it \[the coat\] really worth \$100\?
str_uncomment_string, make_printable_string