Perl Regex: Match this group, but not having this pattern

Dan Dimacuha Source

I need to extract some text that starts and ends with a double quote " but will not extract if it detects multiple double quotes.

This is my example

I tried using different look-arounds, positive/negative look-aheads and look-behinds, but it leads to an error.

In my example above, I would like to exclude the data

"XxXXXXX - ""                                """"XX""""""",  

and

"XxXXXXX - ""XXXXX XXXXXXXX 1.4.90          """"X2""""""",  

from being matched.

I saw some other answers here but I'm getting an error whenever I use a negative look-behind, no problems in positive look-ahead and negative look-ahead but it doesn't work.

Edit:
I've added some examples regex in the link provided, and also more example data. However, I still don't want to match data above by the current regex.

regexperlregex-negationregex-lookarounds

Answers

answered 3 months ago Ho Zong #1

What about using this:

"([^"]+?)"(,|$)

You can see it here and also here

Thanks for this one. Strange, I think I've tried this one before. But didn't get the result I've expected. Maybe it's because I didn't wait for it to be matched again.

comments powered by Disqus