Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by ikegami (Patriarch)
on Mar 29, 2018 at 12:41 UTC ( #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? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2022-08-07 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?