Match regex with php -


i 2 results preg_match , don't understand why. code:

$pattern = "\[precom\]([a-za-z]|\(|\)|[0-9]|\s|\*)*\[\/precom\]"; $data = "[precom](homme) cher monsieur $name[/precom] "; preg_match("/" . $pattern . "/", $data, $m); print_r($m); 

this result:

array ( [0] => [precom](homme) cher monsieur *name[/precom] [1] => e )  

could me find problem please?

from http://www.php.net//manual/en/function.preg-match.php

matches

if matches provided, filled results of search. $matches[0] contain text matched full pattern, $matches[1] have text matched first captured parenthesized subpattern, , on.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -