Php Preg Match All

[Solved] Php Preg Match All | Php - Code Explorer | yomemimo.com
Question : preg_match in php

Answered by : hamza-bin-sajid

<?php
$my_email = "[email protected]";
if (preg_match("/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/", $my_email)) {
echo "$my_email is a valid email address";
}
else
{ echo "$my_email is NOT a valid email address";
}
?>

Source : https://www.guru99.com/php-regular-expressions.html | Last Update : Thu, 05 Nov 20

Question : php preg_match

Answered by : masoud-fesahat

<?php
$subject = "abcdef";
$pattern = '/^def/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?>

Source : https://www.php.net/manual/en/function.preg-match.php | Last Update : Sun, 15 May 22

Question : preg_match in php

Answered by : hamza-bin-sajid

<?php
$my_url = "www.guru99.com";
if (preg_match("/guru/", $my_url))
{	echo "the url $my_url contains guru";
}
else
{	echo "the url $my_url does not contain guru";
}
?>

Source : https://www.guru99.com/php-regular-expressions.html | Last Update : Thu, 05 Nov 20

Question : php preg_match

Answered by : sean-west

preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] ) : int

Source : | Last Update : Fri, 17 Apr 20

Answers related to php preg match all

Code Explorer Popular Question For Php