note 89052 added to function.preg-match
| From: | skds1433 at hotmail dot com | Date: | Thu, 19 Feb 2009 14:41:38 +0000 |
| Subject: | note 89052 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150858@lists.php.net to get a copy of this message | ||
here is a small tool for someone learning to use regular expressions. it's very basic, and
allows you to try different patterns and combinations. I made it to help me, because I like to try
different things, to get a good understanding of how things work.
<?php
$search = isset($_POST['search'])?$_POST['search']:"//";
$match = isset($_POST['match'])?$_POST['match']:"<>";
echo '<form method="post">';
echo 's: <input style="width:400px;" name="search" type="text"
value="'.$search.'" /><br />';
echo 'm:<input style="width:400px;" name="match" type="text"
value="'.$match.'" /><input type="submit" value="go"
/></form><br />';
if (preg_match($search, $match)){echo "matches";}else{echo "no match";}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 98.242.61.56
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/89052
Del: integrated -- https://master.php.net/note/delete/89052/integrated
Del: useless -- https://master.php.net/note/delete/89052/useless
Del: bad code -- https://master.php.net/note/delete/89052/bad+code
Del: spam -- https://master.php.net/note/delete/89052/spam
Del: non-english -- https://master.php.net/note/delete/89052/non-english
Del: in docs -- https://master.php.net/note/delete/89052/in+docs
Del: other reasons-- https://master.php.net/note/delete/89052
Reject -- https://master.php.net/note/reject/89052
Search -- https://master.php.net/manage/user-notes.php