note 126325 added to function.mb-ereg
| From: | Anonymous at main dot php dot net | Date: | Wed, 11 Aug 2021 03:32:41 +0000 |
| Subject: | note 126325 added to function.mb-ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216766@lists.php.net to get a copy of this message | ||
One of the differences between preg_match() & mb_ereg()
about "captured parenthesized subpattern".
<?php
preg_match('/(abc)(.*)/', 'abc', $match);
var_dump($match);
mb_ereg('(abc)(.*)', 'abc', $match);
var_dump($match);
?>
array(3) {
[0]=>
string(3) "abc"
[1]=>
string(3) "abc"
[2]=>
string(0) "" // <-- "string"(0) "" : preg_match()
}
array(3) {
[0]=>
string(3) "abc"
[1]=>
string(3) "abc"
[2]=>
bool(false) // <-- "bool"(false) : mb_ereg()
}
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 222.144.157.176)
----
Manual Page -- https://php.net/manual/en/function.mb-ereg.php
Edit -- https://main.php.net/note/edit/126325
Del: integrated -- https://main.php.net/note/delete/126325/integrated
Del: useless -- https://main.php.net/note/delete/126325/useless
Del: bad code -- https://main.php.net/note/delete/126325/bad+code
Del: spam -- https://main.php.net/note/delete/126325/spam
Del: non-english -- https://main.php.net/note/delete/126325/non-english
Del: in docs -- https://main.php.net/note/delete/126325/in+docs
Del: other reasons-- https://main.php.net/note/delete/126325
Reject -- https://main.php.net/note/reject/126325
Search -- https://main.php.net/manage/user-notes.php