Re: [PHP] Re: One more Regular Expression Question...

2002-05-14 Thread Miguel Cruz
On Tue, 14 May 2002, Brad Melendy wrote: > I'm going to check out preg_match(). What if there are more than one > instance of and in my string, but I know that I want the last two > occurances at the end. Can I tell it to check starting at the end of the > string and work forwards? Thanks agai

Re: [PHP] Re: One more Regular Expression Question...

2002-05-14 Thread Brad Melendy
I want to thank everyone for their help. I finally found the right expression. I needed to start at the end of the string and work backwards. STRRCHR did the trick for me. I was able to use: $match = substr(strrchr($string1, ">"), 1 ); echo $match; I'm actually not sure what role the last "

Re: [PHP] Re: One more Regular Expression Question...

2002-05-14 Thread Brad Melendy
Thanks Miguel, I'm going to check out preg_match(). What if there are more than one instance of and in my string, but I know that I want the last two occurances at the end. Can I tell it to check starting at the end of the string and work forwards? Thanks again! ...Brad "Miguel Cruz" <[EMAI

Re: [PHP] Re: One more Regular Expression Question...

2002-05-14 Thread Miguel Cruz
Preg is more flexible than ereg. if (preg_match('/\(.+?)\<\/a/', $string1, $matches)) print "Matched: {$matches[1]}"; That'll just get what's between the and . http://php.net/preg_match for more info. miguel On Mon, 13 May 2002, Brad Melendy wrote: > Thanks Philip. This gives me ever

RE: [PHP] Re: One more Regular Expression Question...

2002-05-13 Thread Matt Friedman
PROTECTED]] Sent: Monday May 13, 2002 10:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: One more Regular Expression Question... Thanks Philip. This gives me everything before the "'>" that I'm looking for but I believe it is because it occurs more than once. I think I nee

[PHP] Re: One more Regular Expression Question...

2002-05-13 Thread Brad Melendy
Thanks Philip. This gives me everything before the "'>" that I'm looking for but I believe it is because it occurs more than once. I think I need to count the times that "'>" occurs and then try to target the specific occurance that I need. But I'm guessing a little. Thanks for your help. ...

[PHP] Re: One more Regular Expression Question...

2002-05-13 Thread Philip Hallstrom
$string1 = "Here's the Schedule"; ereg(">(.*)", $string1, $matches); $string2 = $matches[1]; Something close to that anyway... On Mon, 13 May 2002, Brad Melendy wrote: > Hello, > I'm pretty stuck here. I wish to assign a variable the value of a > particular substrint of text from a second var