I have one oracle table with one of the columns having below values,
,21A,22,21,28,28
I want to do a regex replace for removal of ,21 (The exact match) but it removes the value from ,21A
Below is my query,
update STUDENT set SCORES = REGEXP_REPLACE(SCORE, ',21' , '', 1, 1) where STUDENT_ID = 1;
How can this be achieved? Any ideas?
,21,and replace with,instead of empty string then?REGEXP_REPLACE(SCORE, ',21(,|$)' , '\1', 1, 1)is enough? Or evenREGEXP_REPLACE(SCORE, ',21(\W|$)' , '\1', 1, 1)?