开发者

MySQL regular expression replace?

I know that MySQL does not have a regular expression replace function but I wondered if anyone has written a user defined function that I could use? I 开发者_StackOverflow社区know it's not good to just ask for code answers but I am not very skilled in MySQL and was just looking for some help. If there isn't I can accept that.

Thanks


Try this site:

http://www.mysqludf.org/lib_mysqludf_preg/


select 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace( replace( replace( 
  replace( replace( replace(

'a~b}c{d`e_f^g\\h[i?j=k;l.m-n,o*p(q&r$s"t u|v]x@y>z<:+)\'%#!\r\f\v\naz\t09\b',

  '~', ''), '}', ''), '{', ''), '`', ''), '_', ''),
  '^', ''), '\\', ''), '[', ''), '?', ''), '=', ''),
  ';', ''), '.', ''), '-', ''), ',', ''), '*', ''),
  '(', ''), '&', ''), '$', ''), '"', ''), ' ', ''),
  '|', ''), ']', ''), '@', ''), '>', ''), '<', ''),
  ':', ''), '+', ''), ')', ''), '\'', ''), '%', ''),
  '#', ''), '!', ''), '\r', ''), '\f', ''), '\v', ''),
  '\n', ''), '\t', ''), '\b', '')

Replace

a~b}c{d`e_f^g\h[i?j=k;l.m-n,o*p(q&r$s"t u|v]x@y>z<:+)\'%#!\r\f\v\naz\t09\b

To

abcdeghijklmnopqrstuxyzaz09

MySQL - Regular Expressions & REPLACE

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜