开发者

Regex for mysql query to match html entities

开发者 https://www.devze.com 2022-12-24 07:46 出处:网络
I understand PCRE pretty well, but MySQL\'s regular expression flavor seems to get the best of me. Can someone help me correct this expression? The PCRE equivalent would be &\\w+;

I understand PCRE pretty well, but MySQL's regular expression flavor seems to get the best of me.

Can someone help me correct this expression? The PCRE equivalent would be &\w+;

I'm guessing something like:

select body from email where body rlike '&[[:alpha:]]+;%'开发者_JAVA百科

Bonus:

MySQL's docs on their regex flavor seem kinda sparse. Does anyone have a good resource specifically geared toward mysql regex they can point me to?


try this:

select body from email where body REGEXP '\&[a-z0-9A-Z]+\;'


Try this. http://www.brainbell.com/tutorials/MySQL/Using_MySQL_Regular_Expressions.htm

0

精彩评论

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

关注公众号