Code: Select all
$regexp = "/Country: .* City: /";
if (preg_match($regexp, "Country: United States (XX) City: (Unknown City?) ", $matches)) {
echo "Match was found <br />";
echo $matches[0];
}
Moderator: General Moderators
Code: Select all
$regexp = "/Country: .* City: /";
if (preg_match($regexp, "Country: United States (XX) City: (Unknown City?) ", $matches)) {
echo "Match was found <br />";
echo $matches[0];
}
Code: Select all
'/(?<=country:).*?(?=city)/is'