News for hackers. Stuff that matters.
Re:Calculate the difference and intersection of any two regexes by mikhailfranco on Tuesday September 12, 2023 @02:31AM (#37477517)
Another interesting question is: how many possible successful matches are there for a given input string. For example:

How many ways can (a?){m}(a*){m} match the string a{m}

i.e. input m repetitions of the letter 'a'.

https://github.com/mike-french/myrex#ambiguous-example

The answer is a dot product of two vectors sliced from Pascal's Triangle.

For m=9, there are 864,146 successful matches.

There are no comments on this comment yet.