I'm pulling my hair out, this seems so simple. I need to check the variable $index$an. I'm looking for any of these... # MO (any two caps letters with a # and space first) #MO (same thing with no space) # mo #mo
Here's what I'm using...
if (($input[$an] =~ /^# [a-z]/) || ($input[an] =~ /^#[A-Z]/)|| ($input[an] =~ /^#[a-z]/)|| ($input[an] =~ /^# [A-Z]/)) { ... }Problem is, even and IP address is matching as long as it has a # in front of it. Can't understand why this would match an ip.
In reply to Regex in if statemetn by finfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |