PHP and other cross-platform languages (maybe Java is not listed in it. :)) Similarly, the regular expression function is also available. the Regular Expression Function of PHP3.0 is far inferior to Perl, but it is still enough. The main functions include:
(1) ereg, eregi
This is a regular expression matching function. The former is case-sensitive and the latter is irrelevant.
Usage: ereg (Regular Expression, String, [matching partial array names]);
The regular expressions in PHP3.0 are similar to those in grep.
(2) ereg_replace, eregi_replace
These are replacement functions.
Usage:
Ereg_replace (Regular Expression, replacement string, original string );
The string processing function has a strtr, which is a "Translation" function, similar to tr/.../in Perl /.../.../,
Usage: strtr (string, "from", "");
For example, strtr ("aaabb", "AB", "cd") returns "cccdd ".
(3) split
It is similar to the explode function, but this time it can be used to split the string where a regular expression is matched.
Usage:
Split (Regular Expression, String, [number of items before removal]);