quick question: my pattern is an svg string and it looks like l 5 0 l 0 10 l -5 0 l 0 -10 To do some unittest comparison against a reference I need to ditch all
I found this solution at https://www.regextester.com/99881, using a lookbehind pattern:
/(?<=(.*l.*))l/g
Or more generally
/(?<=(.*MYSTRING.*))MYSTRING/g
where MYSTRING is something that you want to remove.
(This may also be a useful string for removing all but the first occurrence of "Re:" in an email subject string, by the way.)