Closed paul1149 closed 2 months ago
The correct query would be:
update content set data = regexp_replace(data, '\\sl300', '\\sl290');
Using your example:
select regexp_replace('\pard\sl300\fi0\li0\tx705', '\\sl300', '\\sl290');
-- \pard\sl290\fi0\li0\tx705
Thanks so much for that. I missed that the replacement also needed escaping. Much appreciated. :)
Sure!
Hi, I'm using the latest sqlean regexp.so in the latest DB Browser for SQLite. I'm trying to update a table using the following query:
UPDATE content SET data = regexp_replace ( data , '\\sl300' , '\sl290' ) ;
No error is reported, but nothing is done. However, if I run the same command searching for a literal, it works:
UPDATE content SET data = regexp_replace ( data , 'DejaVu Sans' , 'Open Sans' ) ;
So it seems I'm running a search without benefit of the regex function.
And yet if I run the first search without escaping the backslash in the FIND argument:
UPDATE content SET data = regexp_replace ( data , '**\sl300'** , '\sl290' ) ;
Nothing is changed there either.
Typical text that I'm trying to hit looks like:
\pard\sl300\fi0\li0\tx705
I'm sure I'm creating the problem here, but I don't know where it is. Thanks.