Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Just another Perl shrine
 
PerlMonks  

Re: Finding patterns

by jack123 (Acolyte)
on May 24, 2012 at 05:57 UTC ( #972171=note: print w/ replies, xml ) Need Help??


in reply to Finding patterns

What I understand from your question that you want to find string between two primers, now the two primers shown by you is actually having no string in between them, so I changed it little bit in this way AATCGGGTATGAAAAATTTxyzTGCCGGCGTTTGCG now the text you'll get in between these two primers is xyz. Try the following code and it'll work fine.

$a = 'AATCGGGTATGAAAAATTTxyzTGCCGGCGTTTGCG'; while($a=~/AAAATTT(.*?)TGCCG/g){ print "The variable is $1"; }
Let me know if your question is different than this.


Comment on Re: Finding patterns
Download Code
Re^2: Finding patterns
by MoniqueLT (Initiate) on May 25, 2012 at 01:56 UTC

    WOW those responses were quick!! Thanks so much! Switching out the $_; for $1, and adding () around .*? did the trick!!

    Sorry my question was a bit unclear! Thanks again guys!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://972171]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (18)
As of 2013-06-19 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many continents have you visited?









    Results (658 votes), past polls