Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 contemplating the Monastery: (4)
As of 2014-09-19 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls