in reply to Re: How can I find the first position of a substring case-insensitively?
in thread How can I find the first position of a substring case-insensitively?
It's kind of a pain in the butt, but here's one way:
my $haystack = "foobar"; my $needle = "Bar"; $haystack =~ /($needle)/gi; print ((pos $haystack) - (length $needle));
|
|---|