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:
string1: ATGGCTAGTTTCAGT string2: GTTTATGGGTACGTGT
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:
string1: ATGGCTAGTTTCAGT string2: ATGGGTACGTGT
Can anyone help me please?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to search for a pattern in a string within a certain range
by ikegami (Patriarch) on Mar 08, 2010 at 03:37 UTC | |
|
Re: how to search for a pattern in a string within a certain range
by johngg (Canon) on Mar 08, 2010 at 13:41 UTC | |
by ack (Deacon) on Mar 08, 2010 at 18:53 UTC | |
|
Re: how to search for a pattern in a string within a certain range
by Ratazong (Monsignor) on Mar 08, 2010 at 07:24 UTC | |
by moritz (Cardinal) on Mar 08, 2010 at 07:41 UTC | |
|
Re: how to search for a pattern in a string within a certain range
by Sinistral (Monsignor) on Mar 08, 2010 at 14:59 UTC |