if ($url =~ m/regex/) { .. }
I'm sure someone has a suitable regex for this already.
In reply to regex to match URLs by Anonymous Monk