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 #176240 is a reply to message #176239] Fri, 09 December 2011 12:51 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/9/2011 7:32 AM, Jerry Stuckle wrote:
> On 12/9/2011 6:55 AM, Denis McMahon wrote:
>> On Thu, 08 Dec 2011 22:51:56 -0500, Jerry Stuckle wrote:
>>
>>> OK, guys, I'll be the first to admit my regex knowledge is more than
>>> limited. And I've never used ereg().
>>>
>>> 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))
>>
>> Hmmm
>>
>> By comparing the manual for the two functions:
>>
>> ereg returns false or 0 if no matches depending on the presence of the
>> third parameter, or the length of the matched string (which it puts in
>> $regs[0])
>>
>
> Hi, Denis,
>
> Unfortunately, it's more than that. preg() uses posix regex syntax,
> ereg() uses something else. That's my problem; I don't know the
> differences.
>
> If I know what I'm looking for, I can generally fumble around and get a
> regex that works (as long as it's not too complicated). But this is in a
> generic error handler, and not understanding the ereg() syntax I'm not
> exactly positive what it's looking for.
>

Whoops - said that backwards. ereg() uses posix syntax, preg() uses
something else.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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 26 03:27:48 GMT 2024

Total time taken to generate the page: 0.05047 seconds