in reply to Regex Remove String with Quotations
Welcome to the Monastery!
I think you're over complicating it with all the erroneous double-quotes. If it's just plain ascii, try this:
s/d\"//g;If the d" is after a whitespace (ie. the beginning of a new word), you can do it like this to make the regex a bit more resilient:
s/\bd\"//g;The \b is a "word boundary", and using it in the position I did means 'if a literal lowercase d is followed by a double-quote and is at the beginning of a word (ie. following any whitespace)', replace the d" with an empty string.
Something that I just recently learned that was available and now use periodically besides YAPE::Regex::Explain is use re 'debug';. It might take a bit to get familiar with the output, but exceptionally valuable to learn if you want to understand why your regexes aren't (or are) matching when you think the opposite should be happening.
-stevieb
|
|---|