FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » regex help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: regex help [message #176243 is a reply to message #176237] Sat, 10 December 2011 04:25 Go to previous messageGo to previous message
Curtis Dyer is currently offline  Curtis Dyer
Messages: 34
Registered: January 2011
Karma:
Member
Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:

> OK, guys, I'll be the first to admit my regex knowledge is more
> than limited. And I've never used ereg().

My experience with POSIX regexes is also quite limited, but have you
tried Google'ing for comparisons between PCRE (PHP's preg_*
functions are built on top of PCRE) and POSIX regexes?

A quick search turned up: <http://www.regular-
expressions.info/refflavors.html>, which happens to be a helpful
regex site I've used in the past.

> So, I need to convert the following ereg() call in some code I'm
> modifying to a preg() call. Can someone please tell me what the
> ereg() does and the equivalent preg()?
>
> if (ereg("(error</b>:)(.+)(<br)", $buffer, $regs))

With regard to this specific piece of code, I can't see any obvious
differences in the way this regex pattern behaves in PCRE and POSIX.
For differences in how each function behaves differently, simply
consult the PHP documentation (which also contains a section
explaining PCRE regex syntax).

> TIA.

For a more comprehensive understanding of the two flavors, I would
settle for nothing less than reading the PCRE manual and the POSIX
standard regarding its implementation of regexes.

--
Curtis Dyer
<?$x='<?$x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: <beg> ADODB PHP Extension Help </beg>
Next Topic: Edit a record?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 12 22:04:29 GMT 2024

Total time taken to generate the page: 0.04553 seconds