S
S
Strider McLeod2020-07-27 17:42:07
MySQL
Strider McLeod, 2020-07-27 17:42:07

Regular expression in mysql on update?

There is a request like this

UPDATE products SET full_description = REPLACE(full_description, REGEXP "<h2.+>", "<h2>");


Help me spell it right. The error is here:

REGEXP "<h2.+>"

mysql version 5.1.73

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
ayazer, 2020-07-27
@strider_ua

mysql 8.0+? then

UPDATE products SET full_description = REGEXP_REPLACE(full_description, "<h2.+>", "<h2>");

https://dev.mysql.com/doc/refman/8.0/en/regexp.htm...

S
Stalker_RED, 2020-07-27
@Stalker_RED

REGEXP_REPLACE

UPDATE products SET full_description = REGEXP_REPLACE(full_description, '<h2.+>', '<h2>');

S
Strider McLeod, 2020-07-27
@strider_ua

Old server mysql version 5.1.73

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question