jrblas has asked for the wisdom of the Perl Monks concerning the following question:
I want to find all the matches of a given pattern in a string but doing fuzzy (approximate) pattern matching. I want to allow small variations (1 or 2 positions substituted) in the match. I have tried String::approx module, but I do not know how to manage syntax
... use String::approx 'amatch'; my $pattern = "JEJE"; my $string = "EJKJUJHJDJEJEJEDEJOJOJJJAHJHJSHJEFEJUJEJUJKIJS"; while (?=/$pattern/) { ...
How could I achieve that this 'while' allow 1 substitution from $pattern? That is that "JEFE", "JUJE","JEDE",... would be true matches.
Thanks a lot in advance. JR
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: approximate regular expression
by moritz (Cardinal) on Mar 22, 2012 at 20:59 UTC | |
Re: approximate regular expression
by AnomalousMonk (Archbishop) on Mar 22, 2012 at 23:00 UTC | |
by jrblas (Initiate) on Mar 23, 2012 at 12:38 UTC | |
by AnomalousMonk (Archbishop) on Mar 23, 2012 at 15:42 UTC | |
by jrblas (Initiate) on Mar 25, 2012 at 07:18 UTC | |
by Anonymous Monk on Mar 25, 2012 at 14:48 UTC | |
by JavaFan (Canon) on Mar 23, 2012 at 12:45 UTC | |
Re: approximate regular expression
by Marshall (Canon) on Mar 23, 2012 at 02:34 UTC | |
Re: approximate regular expression
by jandrew (Chaplain) on Mar 22, 2012 at 23:37 UTC | |
by Marshall (Canon) on Mar 23, 2012 at 06:12 UTC | |
by jandrew (Chaplain) on Mar 23, 2012 at 22:00 UTC |
Back to
Seekers of Perl Wisdom