开发者

Pulling RegEx from MySQL into PHP

开发者 https://www.devze.com 2022-12-08 21:09 出处:网络
I am trying 开发者_如何学Pythonto 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 ther

I am trying 开发者_如何学Pythonto 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消