If I have this in a Postgresql 9.1 column:
foo foo <th id="ddd"> foo foo <th id="www"> foo
And I want it to update to this:
foo foo <th> foo foo <th> foo
I’ve tried regex_replace, but I have not succeeded.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you have a table like this:
You can use the following regexp_replace:
The
'g'flag indicates to replace all matching patterns, not only the first one.With this input:
I get the following ouput: