Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Need Help with reg ex

by bichonfrise74 (Vicar)
on Oct 28, 2009 at 04:07 UTC ( [id://803575]=note: print w/replies, xml ) Need Help??


in reply to Need Help with reg ex

Based on how I understand your question, this is how I would do it.
#!/usr/bin/perl use strict; my $count = 0; while (<DATA>) { while ( /(aaggt)/g ) { $count++; print "$1 - Count: $count\n"; print "Found at position : " . pos(), "\n"; pos() += 100; } } __DATA__ aatgatgataaggtaaggtatgatgatgatgatgatagtagannnnnnnnnatgcatga'/atgca.atg +actagca/atgactagcaaggtaaggtaaggtaaggtaaggtatgatgatgannnn./atgatgactag +actgacaaggtaaggtaaggtatgatgatgatcgatgacgat

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-16 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found