in reply to Is regex 1 covered by regex 2
This is very brief attempt under the debugger:
I do not know whether this approach can lead to something interesting, but it would be very hard to make it error proof.$ 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>
Update 18:13 UTC: fixed a typo in line DB<4>.
|
|---|