> 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


In reply to Re: how to measure strictness of a regex ? by LanX
in thread how to measure strictness of a regex ? by didess

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.