Regexp - Escape Character



The escape character in a regular expression is the backslash.

It's needed when the regular expression want to design a meta characters in a regular expression.


  • takes away any special meaning that the meta characters may have.
  • applies both inside and outside character classes.


For example, if you want to match:

  • the backslash itself, you write \\
  • a * character, you write \*

otherwise, they would be have be interpreted as meta-character

Php: Single and double quoted PHP strings have special meaning of backslash. Thus if \ has to be matched with a regular expression \\, then “\\\\” or '\\\\' must be used in PHP code.

Discover More
Multilingual Regular Expression Syntax (Pattern)

Regular expression are Expression that defines a pattern in text. This is therefore a language that permits to define structure of a text. They are a mathematically-defined concept, invented by Stephen...
Regexp - Backslash

Backslash is the general escape meta-character with several uses. It can: Stand for itself, Quote the next character, Introduce an operator, Do nothing see The third use of backslash...
Regular Expression - Meta-(symbols|characters) - Operator

There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Operator...

Share this page:
Follow us:
Task Runner