Specification differences between eleg_replace and mb_ereg_replace

Asked 1 years ago, Updated 1 years ago, 43 views

The formula says ereg_replace is deprecated in PHP 5.3.0, but mb_ereg_replace does not have such a statement.
By name, ereg_replace and mb_ereg_replace seem to use the same mechanism, but is it completely different?

ereg_replace
http://php.net/manual/ja/function.ereg-replace.php

mb_ereg_replace
http://php.net/manual/ja/function.mb-ereg-replace.php

If there is no merit of using mb_ereg_replace, I would like to use preg_replace to unify (´· ··`)

php regular-expression

2022-09-29 21:55

1 Answers

The mb_ereg series uses a tagger just like Ruby, so it seems to be different from both the leg and the preg series.

http://d.hatena.ne.jp/Kenji_s/20130221/php_regexp
http://www.asahi-net.or.jp/~wv7y-kmr/memo/php_mbstring.html#mb_regex

I think it's an easy-to-understand restriction that the preg system cannot handle MBCS other than UTF-8, but if you can convert it by input/output, it won't be a problem.


2022-09-29 21:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.