Table of Contents

Regexp - Escape Character

About

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.

It

Example

For example, if you want to match:

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.