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

Re^2: Regex question

by BillKSmith (Monsignor)
on Sep 17, 2023 at 21:04 UTC ( [id://11154503]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex question
in thread Regex question

If you truly believed that you always had a 'clean string', you would not need a regex test at all. Your latest regex would match any valid string and much more (in fact, nearly every "invalid_string" in my UPDATE). If you post a list of valid string which demonstrate the variation that is allowed and a list of invalid strings which demonstrate the types of errors you want to detect, we probably can make a simpler regex which does the job. You can modify my UPDATE to test a possible regex against all those strings.

Please note that every regex suggestion you have received is only one or two lines long. The best solution probably will be a better fit to your problem, but not much shorter.

Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2026-04-15 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.