in reply to search of a string in another string with 1 wildcard

What have you tried? If not String::Approx then that might be worth a look. You could specify there to be a maximum of 1 substitution with no insertions or deletions which I guess would fulfil your requirements.

The question is also sufficiently general that it says nothing about the use case. It could well be that there is a more appropriate method which relies on some domain knowledge. Without the context we cannot know about this.

  • Comment on Re: search of a string in another string with 1 wildcard

Replies are listed 'Best First'.
Re^2: search of a string in another string with 1 wildcard
by carolw (Sexton) on Jul 09, 2014 at 14:29 UTC

    I get compilation problem

    Can't locate String/Approx.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)

    should I instal any thing?

      Yes, you will need to install String::Approx before you can use it. If you are unfamiliar with installing third-party modules take a look at A Guide to Installing Modules as a starting point. As String::Approx is not a pure-perl module you will need a C compiler also. gcc is a popular choice.