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 are as follows: (1) ereg and eregi are regular expression matching functions. The former is case-sensitive, the latter is SyntaxHighlighter.
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]);