>perl -wMstrict -le "my $invalid = qr{ (?<! :) (?: : | :{3,}) (?! :) }xms; print '------ output ------'; for my $s (@ARGV) { print $s =~ $invalid ? 'NO' : 'OK', qq{ '$s'}; } " "sip:userid@example.com" "sip::userid@example status::code" "::" "::a::" ":::bad_example::" ":" ":::" "::::" ------ output ------ NO 'sip:userid@example.com' OK 'sip::userid@example status::code' OK '::' OK '::a::' NO ':::bad_example::' NO ':' NO ':::' NO '::::'
In reply to Re^2: Regex Validation
by AnomalousMonk
in thread Regex Validation
by jimb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |