while ( going throug the content ) { if($content =~ /\"coiled coil region:\s(\d+)\sto\s(\d+)\"\s\/>/g){ printf ("coiled coil at position: %d, %d found\n", $1, $2); } if($content =~ /\"low complexity region:\s(\d+)\sto\s(\d+)\"\s\/>/g){ printf ("low complexity at position: %d, %d found\n", $1, $2); } $length = ($2 - $1) + 2; substr( $seq, $1 - 1, $length, "X" x $length ); }