Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: how to measure strictness of a regex ?

by LanX (Canon)
on Jan 23, 2013 at 07:39 UTC ( #1014851=note: print w/ replies, xml ) Need Help??


in reply to how to measure strictness of a regex ?

> I hope everyone agrees if I pretend "the first regex is stricter than the second one".

No, your definition of strict is very fuzzy.

> For example, the string ' Daddy' matches

Are the strings given or could they come from a defined set? Like [a-zA-Z]{1,20} ? Is the set infinite?

> anything allowing classifying regexes

Please be aware that regexes are almost a complete sub-language with recursions and more. You don't expect us to solve the halting problem for the general case , don't you?

So which restricted regex syntax is allowed?

I have an idea for a clear definition of "strictness" and an approach to solve this by estimating the cardinality of possible solutions...

But I'm reluctant to spend efforts w/o a clear problem description. Sorry!

Like davido already asked, could you please clarify what for you're wanting this?

Seems pretty much to be a XY Problem for me...

Cheers Rolf


Comment on Re: how to measure strictness of a regex ?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-07-07 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls