View Single Post
Old 10-17-2021, 07:03 AM   #1
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 168
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing
“bogus escape error” in regex

Wanting to remove the parenthesis around the final text between parenthesis at the end of book titles, I tried to replace (.*) \((.*)\)$ with \1 \2 and got the ominous warning:“bogus escape error”

Seem python does not like having the laxt regex character escaped.

But I found a simple bodge to get around the problem.

First step, in Character match, replace ) with )X

Then in Regular expression replace (.*) \((.*)\)X$ with \1 \2

Worked a treat.
rolgiati is offline   Reply With Quote