Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Anything that is not ',' except .... RegEx question

by Punitha (Priest)
on Feb 27, 2008 at 12:47 UTC ( #670615=note: print w/ replies, xml ) Need Help??


in reply to Anything that is not ',' except .... RegEx question

Hi Win, you can try like this also,

use strict; while(<DATA>){ chomp; if(($_!~/,/i)||($_=~/,(?= (?:city of|country of))/i)){ print "$_\n" } }

Punitha


Comment on Re: Anything that is not ',' except .... RegEx question
Download Code
Re^2: Anything that is not ',' except .... RegEx question
by Win (Novice) on Feb 27, 2008 at 14:18 UTC
    Anyone,

    Is it possible to incorporate this into the regex I have shown in the question please? One issue I can see with the regex above is that there needs to be a space between the "," and the follow string City of|County of.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-07-26 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (179 votes), past polls