Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Comparison by position and value

by !1 (Hermit)
on Jan 02, 2005 at 21:42 UTC ( [id://418820]=note: print w/replies, xml ) Need Help??


in reply to Comparison by position and value

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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://418820]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found