I wrote the regex expression like this
^[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+$
Which is checking the the string is symbol only
I use the checker to check that the regex is correct.
Then I put it into my php code
$regex = "^[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+$";
$regex = '^[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+$';
Both I tried and its not work because the quote is broken by the quote in the regex.
I don't want to concat them like
$regex="{partA}".'"'."{partB}";
I think this is too difficult to read and not easy to maintenance
How do I solve this problem?