<?php
// type of regular expression
//posix style regular exrpession
//pcre style regular expression
$sentence = "I lob to have tea but some time I prefer coffee";
$regexp="love|lob|feelings";
// search the search the mentioned words in the sentence
if(ereg($regexp,$sentence))
{
echo "regular expression is true";
}
else
{
echo "regular expression is false";
}
?>
Tuesday, October 21, 2014
Regular expression example 3
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment