I kinda doubt it's fast but it certainly is short.
sub compat { my ($f,$s) = @_; my $neg = "[^".join("",grep $_ ne "_", split//, $f)."]"; $f =~ s/((.)\1*)/$1 eq "_" ? "$neg\{".length($2)."}":"[$1_]"/ge; return $s =~ $f; }
In reply to Re: Comparison by position and value
by !1
in thread Comparison by position and value
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |