Welcome to the Monastery | |
PerlMonks |
how to search for a pattern in a string within a certain rangeby BhariD (Sexton) |
on Mar 08, 2010 at 03:30 UTC ( [id://827307]=perlquestion: print w/replies, xml ) | Need Help?? |
BhariD has asked for the wisdom of the Perl Monks concerning the following question: If I have to search for a pattern in a string within certain range of the string then what should I specify? For example I have the following string:
the search pattern is 'TTT'. I want to search the pattern in the start of the string (not in the middle or in the end), or only up till 8 characters, once pattern is identified, remove the characters before the pattern along with the pattern. so my output will be like:
Can anyone help me please? Thanks
Back to
Seekers of Perl Wisdom
|
|