-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Here's a normal replacement, without any anchors (works fine):
mysql> SELECT REGEXP_REPLACE('ABCABC', 'A', '*');
+------------------------------------+
| REGEXP_REPLACE('ABCABC', 'A', '*') |
+------------------------------------+
| *BC*BC |
+------------------------------------+
1 row in set (0.00 sec)
If we add the beginning of line anchor, it fails to replace:
mysql> SELECT REGEXP_REPLACE('ABCABC', '^A', '*');
+-------------------------------------+
| REGEXP_REPLACE('ABCABC', '^A', '*') |
+-------------------------------------+
| ABCABC |
+-------------------------------------+
1 row in set (0.00 sec)
End of line anchor works fine:
mysql> SELECT REGEXP_REPLACE('ABCABC', 'C$', '*');
+-------------------------------------+
| REGEXP_REPLACE('ABCABC', 'C$', '*') |
+-------------------------------------+
| ABCAB* |
+-------------------------------------+
1 row in set (0.00 sec)
Metadata
Metadata
Assignees
Labels
No labels