Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: regex challenged

by redgreen (Priest)
on Oct 07, 2009 at 20:21 UTC ( #799805=note: print w/replies, xml ) Need Help??

in reply to regex challenged

Besides using placeholders as moritz said, it is always easier to test for characters you want allowed (a known set) in a regex, rather then trying to come up with what isn't allowed (an unknown large set).

if ( $User =~ /^[a-z0-9]+$/i ) { # Allowed }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://799805]
[Corion]: Discipulus: Yeah, I rediscovered it when I wanted to have a simple (cross-platform) wrapper for my OpenGL program so it has a nice window etc
[Corion]: ... and one thing leads to another, so ambrus provided the integration with AnyEvent so I can now conveniently make HTTP requests from that app too :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-12-09 09:14 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (150 votes). Check out past polls.