Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Looking for a regular expression for the following pattern.

by ikegami (Patriarch)
on Mar 29, 2018 at 12:41 UTC ( [id://1211969]=note: print w/replies, xml ) Need Help??


in reply to Looking for a regular expression for the following pattern.

[0-9_]*[a-zA-Z][a-zA-Z0-9_]*

So to check if an entire string matches one of your sequences,

if ($str =~ /^[0-9_]*[a-zA-Z][a-zA-Z0-9_]*\z/) { ... }

Replies are listed 'Best First'.
Re^2: Looking for a regular expression for the following pattern.
by Skeeve (Parson) on Mar 29, 2018 at 17:35 UTC

    ++ for finally making me clear what's \z is good for…


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found