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

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

by Skeeve (Parson)
on Mar 29, 2018 at 06:37 UTC ( #1211955=note: print w/replies, xml ) Need Help??


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

So is it alway an underscore after 2 characters?

Otherwise this should do:

/^[a-z0-9_]+$/i

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

Replies are listed 'Best First'.
Re^2: Looking for a regular expression for the following pattern.
by ikegami (Patriarch) on Mar 29, 2018 at 12:37 UTC

    That matches "_" and "a\n"

      1. OP didn't say anything about linefeeds so it's safe to assume they can be ignored
      2. OP didn't say that "_" is not allowed. It's "alphanumeric characters with underscores, one or more"
      3. OP's post is poorly written so expect a poorly written reply ;)

      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
        It is true that the OP is not specific enough (far from that), but if you're suggesting /^[a-z0-9_]+$/i, you might as well suggest /^\w+$/. And this is even less specific than the examples shown by the OP.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2022-08-10 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?