Home > database >  Regular expressions, replace all the Numbers to # field
Regular expressions, replace all the Numbers to # field

Time:10-07

All fields may include any number, A number into #

CodePudding user response:

MYSQL does not support the regular replacement, can be directly

The update t
The set x=replace (replace (replace (replace (x, '0', '#'), '1', '#'), '2', '#'), '3', '#')

CodePudding user response:

if it is a Java, can use the replaceAll (" \ \ d ", "#")
Such as:
String STR="a1b2c3d45". ReplaceAll (" \ \ d ", "#");
System.out.println(str);
Output the result is: # b# d# c # #

CodePudding user response:

No regular expressions in mysql, only number to replace the one by one
  • Related