XP is just a number | |
PerlMonks |
grep match variable positionby Anonymous Monk |
on May 16, 2016 at 11:33 UTC ( [id://1163128]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Hello monks I use the following to discard stopwords, which are saved in an array, from my process
This works fine if my $word has only one word, it just matches everywhere. It becomes complicated if $word is made out of more words, as I don't want to consider $word a stopword according to the position of the match. What I need to do is to exactily control the grep match, which means: the position of the match, where the stopword is found in $word, for example at the beginning or at the end of $word. With $word="of the blue" match is true, $word="the blue of" match is true, $word="out of blue" match is no true No idea where to start. I ould be glad if someone could give me some hint to work on.
Back to
Seekers of Perl Wisdom
|
|