Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Regex Doubt

by pvaldes (Chaplain)
on Nov 12, 2012 at 11:30 UTC ( #1003421=note: print w/ replies, xml ) Need Help??


in reply to Regex Doubt

I love to cheat (and I love to check too). Look at the last line of data

/i is said yet, so its use here is intentionally omitted

use strict; use warnings; while (<DATA>){ if (/([Bb]arton-[Ll]e-[Cc]lay|[Mm]ilton\s+[Kk]eynes|[Gg]lasgow|[Bb]art +on-le-[cC]lay \(near [Ll]utton\))\s?$/){ print $1,"\n"} else {print "-- what? --\n"} } __DATA__ Part Time - Weekend Receptionist - Barton le Clay - Barton-le-Clay (ne +ar Luton) Part-Time Weekend Day Veterinary Nurse - Milton keynes Receptionist - barton-le-clay (near luton) Full time liar - Glasgow (Australia)


Comment on Re: Regex Doubt
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-08-29 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls