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 }
In reply to Re: Re: substring exists at particular postion?
by joealba
in thread substring exists at particular postion?
by redemption
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |