Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
I need to match entire words in strings. Words may or may not include an hyphen. Why is the following not working?
$mystring =~/\b($query)\b/i
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex hyphen
by GrandFather (Saint) on Nov 25, 2014 at 10:34 UTC | |
|
Re: Regex hyphen
by Eily (Monsignor) on Nov 25, 2014 at 11:01 UTC | |
|
Re: Regex hyphen
by Anonymous Monk on Nov 25, 2014 at 12:11 UTC | |
|
Re: Regex hyphen
by Anonymous Monk on Nov 25, 2014 at 10:34 UTC |