Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-11-27 16:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls