woody993
woody993

Reputation: 659

Pulling RegEx from MySQL into PHP

I am trying to get the regex string from a table, but as soon as I put it into preg_match it throws an error about an unexpected "\". If I use the exact same string directly there is no issue.

Upvotes: 0

Views: 116

Answers (1)

Franz
Franz

Reputation: 11553

Just in case you haven't solved this yet ;)

In the comment you posted as comment to the other answer, you have an occurence of the following string: \\/\. I suppose that the first backslash escapes the second one, although it should probably escape the slash, as that is the regex delimiter. As it is not, it is taken as delimiter (which should already throw an error because of the position) and the following backslash is taken as modifier - which is unknown.

Upvotes: 1

Related Questions