REGEX-Escape for: ^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]...

Your Input:
Result, the escaped string:
\^\\s\*\\\(\?\(020\[7,8\]\{1\}\\\)\?\[ \]\?\[1\-9\]\{1\}\[0\-9\{2\}\[ \]\?\[0\-9\]\{4\}\)\|\(0\[1\-8\]\{1\}\[0\-9\]\{3\}\\\)\?\[ \]\?\[1\-9\]\{1\}\[0\-9\]\{2\}\[ \]\?\[0\-9\]\{3\}\)\\s\*\$


Ads

What must the escaping look like for:
^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\s*$

The excaped text for use in a regex is:

\^\\s\*\\\(\?\(020\[7,8\]\{1\}\\\)\?\[ \]\?\[1\-9\]\{1\}\[0\-9\{2\}\[ \]\?\[0\-9\]\{4\}\)\|\(0\[1\-8\]\{1\}\[0\-9\]\{3\}\\\)\?\[ \]\?\[1\-9\]\{1\}\[0\-9\]\{2\}\[ \]\?\[0\-9\]\{3\}\)\\s\*\$


Ads