in reply to Is regex 1 covered by regex 2

Hum, a very limited try at using the regex engine to simplify the string entered by the user and see if it can be matched by an existing regex. The idea is to remove any occurrence of .*, to replace (.)+ by a single occurrence of the letter matched by (.), etc.

This is very brief attempt under the debugger:

$ perl -dE 42 Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 42 DB<1> $regex = qr/abc.*f/; DB<2> $new = "abcd.*f"; DB<3> $new =~ s/.\*//g; DB<4> $new =~s/(.)\+/$1/g; DB<5> p $new; abcdf DB<6> print "true" if $new =~ /$regex/; true DB<7>
I do not know whether this approach can lead to something interesting, but it would be very hard to make it error proof.

Update 18:13 UTC: fixed a typo in line DB<4>.

Je suis Charlie.