Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Does a regex exist for this problem?

by petral (Curate)
on Jan 26, 2002 at 00:48 UTC ( [id://141641]=note: print w/replies, xml ) Need Help??


in reply to Regex to find intersection of two words

sub includes { my($in, $test) = @_; my $ins = join '', sort split//, $in; my $ts = join '.*', sort split//, $test; return $ins =~ /$ts/ || 0 }
or, similar to andye and Juerd above,
sub includes { my($in, $test) = @_; return (length $test == grep $test=~s/$_//, $in=~/./g) ||0; }

  p

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-23 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found