Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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
Replies are listed 'Best First'.
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 about the Monastery: (5)
As of 2015-07-28 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls