If I want to capture a pipe character |
in the capture group of a regular expression then it needs to be backslash escaped so it isn't interpreted as an alternator.
(and\|or) matches the string "and|or"
(and|or) matches the strings "and" and "or"
What other characters need to be escaped inside a capture group in order to be interpreted literally? Is there a comprehensive list of these characters?