Thanks for the replies.
The problem was that Regex stops at the first hit in the previous example. So it saw a "C" as first character, and than checked it against "[^A]" and immediately stopped searching further.
I fixed it by doing this:
if('CCTAGG' =~ /^[^A]*$/) {
print "match";
}
I can't figure out why the following does not work.
if('CCTAGG' =~ /[^A]/) {
print "match";
}
I would expect that it would not match because the string has a A in it. But it DOES match. Can someone explain this to me?
When I remove the carrot (^), than it also matches. Which I expect...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.