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

Re: Re: Finding a _Similar_ Substring? (Fuzzy Searching?)

by TomDLux (Vicar)
on May 21, 2004 at 03:14 UTC ( #355167=note: print w/replies, xml ) Need Help??

in reply to Re: Finding a _Similar_ Substring? (Fuzzy Searching?)
in thread Finding a _Similar_ Substring? (Fuzzy Searching?)

If your ignore set are too complicated for character classes, you can OR them together into a regex. I doubt it would be necessary here, more likely for sets fo words.

my $ignoreStrings = join "|", @ignore; my $deleteThese = qr/$ignoreStrings/g; $strting =~ s/$deleteThese//;

By the way, you're using $_ to represent the various elements of @ignore, but also to denote the default object of s///. That's why I tend to avoid defaults .... better to be explicit, self-documenting, and avoid irritating errors.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://355167]
and a log crumbles through the grate...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2018-07-21 10:00 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (446 votes). Check out past polls.