In one of the StackOverflow Podcasts (the one where guys were discussing data generation for testing DBs -- either #11 or #12), Jeff mentioned something like "reverse regular expressions", which are used exactly for that purpose: given a regex, produce a string which will eventually match said regex.
What is the correct term for this whole concept? Is this a well-known concept?
Another way to show that reverse(L) is regular is via regular expressions. For any regular expression r you can construct a regular expression r such that L(r ) = reverse(L) using the inductive definition of regular languages.
"Regex Generator is a simple web interface to generate regular expressions from a set of strings."
The regular expression engine does not backtrack because {2} is not an optional quantifier; it specifies an exact number and not a variable number of times that the previous subexpression must match.
'?' matches/verifies the zero or single occurrence of the group preceding it. Check Mobile number example. Same goes with '*' . It will check zero or more occurrences of group preceding it.
The Perl module String::Random
(in the CPAN) does this. Takes a subset of regular expressions, and does a random walk through it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With