Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: wanting a more explicit regex

by poolpi (Hermit)
on Feb 12, 2008 at 14:12 UTC ( [id://667568]=note: print w/replies, xml ) Need Help??


in reply to wanting a more explicit regex

#!/usr/bin/perl use strict; use warnings; my @url = ( 'a2.xyz', 'c3.xy1', 'b1.xyz1', 'a3.xy11'); for (@url){ $_ .= '.nota.url'; / [a-c][1-3] [.] xy (:? z[1]? | 1 ) [.] nota [.] url /xms ? print "$_ : OK\n" : print "$_ : NOK\n"; }
Output: a2.xyz.nota.url : OK c3.xy1.nota.url : OK b1.xyz1.nota.url : OK a3.xy11.nota.url : NOK

hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found