UPDATE REPLACE random string with same beginning and ending in MariaDB 10
by Aeolustw from LinuxQuestions.org on (#6FY3Z)
Hi,
The strings:
<r>[quote name='Angel' date='Jan 5 2005, 21:36 PM']...
<r>[quote name='ABC' date='Mar 7 2005, 13:07 PM']...
<t>[quote name='DEF' date='Sep 2 2005, 22:10 PM']...
I want to replace [quote name='DEF' date='Sep 2 2005, 22:10 PM'] with <QUOTE><s>[quote]</s>
The beginning string is [quote name= and the end one is ']
And I try:
Code:UPDATE phpbb_posts SET post_text = REGEXP_REPLACE (post_text, '\[quote name=.*\'\]' , '<QUOTE><s>[quote]<\/s>') WHERE post_text LIKE '%quote name=%' ;The results data in show too many:
<r>[<QUOTE><s>[quote]</s><QUOTE><s>[quote]</s><QUOTE><s>[quote]</s>...
Ant hit?
Thanks.
The strings:
<r>[quote name='Angel' date='Jan 5 2005, 21:36 PM']...
<r>[quote name='ABC' date='Mar 7 2005, 13:07 PM']...
<t>[quote name='DEF' date='Sep 2 2005, 22:10 PM']...
I want to replace [quote name='DEF' date='Sep 2 2005, 22:10 PM'] with <QUOTE><s>[quote]</s>
The beginning string is [quote name= and the end one is ']
And I try:
Code:UPDATE phpbb_posts SET post_text = REGEXP_REPLACE (post_text, '\[quote name=.*\'\]' , '<QUOTE><s>[quote]<\/s>') WHERE post_text LIKE '%quote name=%' ;The results data in show too many:
<r>[<QUOTE><s>[quote]</s><QUOTE><s>[quote]</s><QUOTE><s>[quote]</s>...
Ant hit?
Thanks.