poirot Posted June 15, 2006 Share Posted June 15, 2006 I've been wondering, between the two sets of functions, which one(s) should I should when coding a script that is intended to be distributed?PCRE is often considered faster - and better - than the POSIX set, but the Manual says:"Regular expression support is provided by the PCRE library package..."This means there are chances of some server don't support them, right? Should I have this in mind and use ereg? To further increase confusion, here is some weird discussion about"Move ereg to PECL"[a href=\"http://www.php.net/~derick/meeting-notes.html#move-ereg-to-pecl\" target=\"_blank\"]http://www.php.net/~derick/meeting-notes.h...ve-ereg-to-pecl[/a]What should I do?Thanks [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/ Share on other sites More sharing options...
effigy Posted June 15, 2006 Share Posted June 15, 2006 This is covered in "Mastering Regular Expressions." In a nutshell, POSIX was an attempt at standardization. One positive is that is uses locales; however, this is alleviated when tools work with Unicode. Then came Perl, and thus PCRE, which really spiffed up regular expressions capabilities.See [a href=\"http://en.wikipedia.org/wiki/Regular_expressions\" target=\"_blank\"]http://en.wikipedia.org/wiki/Regular_expressions[/a]. Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/#findComment-45969 Share on other sites More sharing options...
gentooman Posted August 31, 2008 Share Posted August 31, 2008 Hello Poirot,I have always used PCRE and I have never had any problems with support. Also, I just read somewhere, possibly the "Mastering Regular Expressions" Third edition thread, that support for POSIX regular expressions might be dropped from PHP 6. I think that speaks for itself. Also, if you need to write a script in Perl you will feel at home. Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/#findComment-630159 Share on other sites More sharing options...
DarkWater Posted August 31, 2008 Share Posted August 31, 2008 [quote author=gentooman link=topic=95922.msg979081#msg979081 date=1220157820]Hello Poirot,I have always used PCRE and I have never had any problems with support. Also, I just read somewhere, possibly the "Mastering Regular Expressions" Third edition thread, that support for POSIX regular expressions might be dropped from PHP 6. I think that speaks for itself. Also, if you need to write a script in Perl you will feel at home.[/quote]Actually, those talks were finalized. POSIX is being dropped from PHP6 and will ONLY be available through PECL, while PCRE CANNOT be removed after PHP5.3. Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/#findComment-630329 Share on other sites More sharing options...
nrg_alpha Posted August 31, 2008 Share Posted August 31, 2008 How does a thread that is two years old get revived? lol Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/#findComment-630340 Share on other sites More sharing options...
DarkWater Posted August 31, 2008 Share Posted August 31, 2008 [quote author=nrg_alpha link=topic=95922.msg979263#msg979263 date=1220189637]How does a thread that is two years old get revived? lol[/quote]LOL I didn't even notice that, I just posted because I saw it at the top of the board. Ahahaha. Link to comment https://forums.phpfreaks.com/topic/12040-ereg-vs-preg/#findComment-630345 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.