http://qs321.pair.com?node_id=1211969


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