\n"; print_r ($array); print "\n"; } print "
"; $text = "158.152.55.35"; if ( preg_match ("/(\d+)\.(\d+)\.(\d+)\.(\d+)/",$text, $array) ) { print "
\n";
	print_r ($array);
	print "
\n"; } print "
"; //branches |, match either the first pattern or the second $text = "www.example.com"; if ( preg_match ("/www\.example(\.com|\.uk)/",$text, $array) ) { print "
\n";
	print_r ($array);
	print "this is a $array[1] domain
"; print "
\n"; } print "
"; ?>