in reply to A single regex
"Maximally one underscore", like "maximally n anything", is easiest done adding a negative lookahead after the start anchor:
/^(?!.*_.*_)\w*[A-Za-z]\w*$/
(That is also the most readable way, IMO, and not too slow, though if execution speed is an issue, doing it as a single regex is probably wrong anyway.)
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|