Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 avoiding work at the Monastery: (11)
As of 2015-07-06 21:28 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 (83 votes), past polls