Created
February 10, 2015 19:26
-
-
Save allenfernzz/a28cc9d14770980f0747 to your computer and use it in GitHub Desktop.
Revisions
-
Allen Fernandes created this gist
Feb 10, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <?php //An Regular Expression Parser for Time followed by a text function check_for_time() { //we are following 24 hour clock pattern $string = "02:00 am I am still working"; $pattern = "/([01]?[0-9]|2[0-3]):[0-5][0-9]/"; if (preg_match($pattern, $string, $matches)) { echo "<br/>Match was found <br />"; echo $matches[0]; } } check_for_time(); ?>