in reply to How Do I Skip Spaces At The End of Words Using A Regex?
In addition to using quotemeta or \Q...\E, the g should be removed.
Furthermore, /\Q$y\E\s+/i is the same as /\Q$y\E\s/i (because of the lack of anchors and captures), and /\Q$y\E/i would surely suffice in this case.
Lastly, if ($x =~ /\Q$y\E/i) is slower than if (index(lc($x), lc($y)) >= 0).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How Do I Skip Spaces At The End of Words Using A Regex?
by jwkrahn (Abbot) on Sep 18, 2006 at 08:36 UTC | |
|
Re^2: How Do I Skip Spaces At The End of Words Using A Regex?
by Not_a_Number (Prior) on Sep 18, 2006 at 08:27 UTC |