REGEX-Escape for: ^[0-9]{5}(?:-[0-9]{4})?$

Your Input:
Result, the escaped string:
\^\[0\-9\]\{5\}\(\?\:\-\[0\-9\]\{4\}\)\?\$

Ads

What must the escaping look like for:
^[0-9]{5}(?:-[0-9]{4})?$

The excaped text for use in a regex is:

\^\[0\-9\]\{5\}\(\?\:\-\[0\-9\]\{4\}\)\?\$


Ads