Literal string and escape character of regular expressions Parent topic

To match a character that has a special meaning in regular expressions (example: +), you need to use the backslash \ escape character. For example, to match string C/C++, use the expression C\/C\+\+.
Sometimes, you have to add many escape characters to your expression (example: C\/C\+\+). In this situation, enclose the string C/C++ in double-quotes (example: .REG "C/C++") then the new expression is equivalent to the old one. Characters (except \ which is an escape character) within double-quotes are literal. The following are some examples:
Expression Description
"C/C++" Match string C/C++ (does not include double-quotes)
"Regular\x20Expression" Match string Regular Expression (does not include double-quotes), where \x20 means the space character.
"[xyz]\"foo" Match the literal string: [xyz]"foo
Change the adjacent <space> to "\x20" for the following in a regular expression:
  • .AND.
  • .OR.
  • .NOT.
  • .WILD.