|
Posted by Mladen Gogala on 11/13/37 11:20
On Sun, 03 Jul 2005 21:08:30 -0700, el_roachmeister wrote:
> Is there a good article that explains why php does not support =~ like
> perl for regex? I am confused by all the different ways one can do
> regex in php but it would seem supporting =~ would eliminate alot of
> redundancy. What am i missing here?
PHP is not Perl. PHP5 has completely different object model, you have the
same kind of syntax for numeric and hash arrays and you have several types
of regex functions which can be categorized into preg functions and the
useless ones. Every other language except Perl (Python, Java, PL/SQL, PHP)
uses functions for regular expressions. Of course, if you've ever read Lex
and Yacc book, you know that =~ is also a function, only disguised as an
operator. Functional syntax is not much harder then the Perl one.
--
http://www.mgogala.com
[Back to original message]
|