argv has asked for the wisdom of the Perl Monks concerning the following question:
I want to see if a given string is off by 1 character from the test string. Thus,
If my test string is "foo bar baz", I want to have a function that matches any one of:
fooo bar baz foo bar baaz foo bbar baz [etc]
Here, I'm looking for off-by-one errors. Extra bonus for a function that matches if it's off by an arbitrary N. That is, a function that returned the number of characters that were different between the strings rather than just a binary true/false.
Dan Heller
http://www.danheller.com
http://www.danheller.com
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: off-by-one string comparison
by Zaxo (Archbishop) on Jun 05, 2005 at 17:42 UTC | |
Re: off-by-one string comparison
by bobf (Monsignor) on Jun 05, 2005 at 17:46 UTC | |
Re: off-by-one string comparison
by crashtest (Curate) on Jun 05, 2005 at 19:15 UTC | |
Re: off-by-one string comparison
by TedPride (Priest) on Jun 05, 2005 at 22:12 UTC |
Back to
Seekers of Perl Wisdom