in reply to Re: substring exists at particular postion?
in thread substring exists at particular postion?
Since you mentioned that you'd be looking for the string in more than one position, this will allow you to do the match once.my $bigStr = 'Once upon a time there was a little programer'; my $littleStr = 'time'; if ($bigStr =~ /^(.*?)$littleStr/) { my $position = length($1); print "Found $littleStr at position $position\n"; # Do whatever depending on the position returned }
|
|---|