I am a perl beginner and need some help with regex Input for this code is : aatgatgataaggtaaggtatgatgatgatgatgatagtagannnnnnnnnatgcatga'/atgca.atgactagca/atgactagcaaggtaaggtaaggtaaggtaaggtatgatgatgannnn./atgatgactagactgacaaggtaaggtaaggtatgatgatgatcgatgacgat... and so on

Here i am trying to assign input file as a scalar variable and trying to find a match of "aaggtaaggt" and then skip some 100 characters whether they are alphabets or symbols or any wildcard characters after skipping exact 100 characters, i am again asking code to start search for match again and every time it finds a match , i am counting and asking to print..

As of my knowledge i have tried using substr of match as pos1 and had set offset for 100 and then assigned that as initial pos for reading second match , but failed to get the correct output, then tried here post match as $' but doubt whether it is correct or not.

Hi Thanks for the reply I have a question from ur reply whats the use of usr/bin/env perl here instead of usr/bin/perl and i havent understood this regex..whats the use of gmsx here.i mean this looks like high level perl..cud u plz explain this regex.. onceagain..thank you. while m{ ( (?:aaggt){2} ) ( .{100} ) }gmsx;

Hi Thanks for the reply I have a question from ur reply whats the use of usr/bin/env perl here instead of usr/bin/perl and i havent understood this regex..whats the use of gmsx here.i mean this looks like high level perl..cud u plz explain this regex.. onceagain..thank you. while m{ ( (?:aaggt){2} ) ( .{100} ) }gmsx;

env(1) is a UNIX command that finds the program named in its argument and executes it. It is done this way because on some machines, perl is not stored in /usr/bin/

The /gmsx are modifiers for the match. See http://perldoc.perl.org/perlre.html#Modifiers

/g means repeat the match as often as possible.

/m means that ^ matches the start of a line not the start of the string and $ matches the end of a line not the end of the string.