in reply to How can I find the first position of a substring case-insensitively?

As far as I know you cannot make index() case insensitive.
I think the simpliest thing to do is to make you string case insensitive.
Ex.
my $lcstr = lc $mystr; my $ind = index($lcstr,"a");
This way "a" matches the first instance of "A" or "a" in the original $mystr.
Hope that helps.

Originally posted as a Categorized Answer.

  • Comment on Re: How can I find the first position of a substring case-insensitively?
  • Download Code