Pattern matching consecutive characters
I have a list of strings that I would like to search through and ignore
any that contain A or G characters that occur more than 4 times
consecutively. For instance, I would like to ignore strings such as
TCAAAATC or GCTGGGGAA.
I've tried:
unless ($string =~ m/A{4,}?/g || m/G{4,}?/g)
{
Do something;
}
But I get an error message "Use of uninitialized value in pattern match
(m//)".
Any suggestions would be appreciated.
No comments:
Post a Comment