in reply to Partial Searches Against Multiple Wildcards

Since there are only a few thousand, just save a regular expression for each one:
my $v = "D7*D-48*6"; my $r = $v; $r =~ s/-/-?/g; # Dash optional $r =~ s/\*/./g; # * any character ("D7RD" =~ m/$r/) ? ....

Replies are listed 'Best First'.
Re^2: Partial Searches Against Multiple Wildcards
by LanX (Saint) on Dec 18, 2023 at 02:24 UTC
    Which obviously doesn't work. The pattern can be a sub-part of the string, not the other way round.

    You should test before posting.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

    A reply falls below the community's threshold of quality. You may see it by logging in.