|Perl: the Markov chain saw|
Answer: How can I find the first position of a substring case-insensitively?by ambrus (Abbot)
|on Oct 01, 2003 at 12:43 UTC||Need Help??|
Q&A > strings > How can I find the first position of a substring case-insensitively? - Answer contributed by ambrus
You could use regexps, like this:
this works even if $needle has regexp-metacharacters in it.
But @- exists only in newer perls (from 5.6.1 I think). In perl 5.005 you could use something like
but note that $` makes perl slower.
Whitespace added by tye