Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: RegEx ignoring intervening characters?

by gaal (Parson)
on Jan 19, 2007 at 20:55 UTC ( [id://595592]=note: print w/replies, xml ) Need Help??


in reply to RegEx ignoring intervening characters?

The class of non uppercase English characters is [^A-Z]. So you need

$str =~ /^A[^A-Z]*B[^A-Z]*C[^A-Z]*D$/;

You can write this a little more clearly as:

my $nu = qr/[^A-Z]*/; $str =~ /^ A ${nu} B ${nu} C ${nu} D $/x;

(Use [:^upper:] or the Unicode \P{IsUpper} for non-English text.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-24 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found