I am new to regex, and as i have studied, the * matches zero or more and + matches one or more, so i started to test this:
<?php
preg_match("/a/", 'bbba',$m);
preg_match("/a*/", 'bbba',$o);
preg_match("/a+/", 'bbba',$p);
echo '<pre>';
var_dump($m);
var_dump($o);
var_dump($p);
echo '</pre>';
?>
but the result is that * didn't match any thing and returned empty while the letter a exists:
array(1) {
[0]=>
string(1) "a"
}
array(1) {
[0]=>
string(0) ""
}
array(1) {
[0]=>
string(1) "a"
}
so what i miss here.