I work with Perl to find and match strings in each line that matches the criteria, and would like to omit lines that contain a specific line. I mean: Let's say I match the string Mouse, but I would like to skip if the string matches X123Y. Any line can be found anywhere on the line.
Stackoverflow Mouse forum. <--Match Stackoverflow -Mouse- forum. <--Match Stackoverflow X123Y forum Mouse. <--Should not Match Stackoverflow XYZ forum Mouse. <--Should not Match
I was hoping this would solve it, as I use a negative look, but it doesn't seem to be a trick.
(?i)(\WMouse\W|(?!(X123Y|XYZ)).*$)
I am doing something fundamentally wrong, I suppose, but I donโt see it now.
Any help?
source share