usr bin perl str img http img if str img http img ig print TRUE else p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/usr/bin/perl
$str = '[img]http://a&s[/img]';
if ($str =~ m/\[img\]http:\/\/.*?[\?|\&].*?\[\/img\]/ig){
print "TRUE\n";
}else{
print "FALSE";
}