RE: Problem

From: Date: Tue, 07 Aug 2001 12:11:39 +0000
Subject: RE: Problem
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-8696@lists.php.net to get a copy of this message
The biggest thing you need to consider here is that you're using * interchangably as a character to look for, and also as a wildcard operator: .* is a combination; the . means any character and the * means 0 or more occurrences of it. Therefore a.*a would match azzzzza, but also aa. Similarly + means match 1 or more occurrences. Another thing to bear in mind is that * is what's known as hungry, so <.*> will pull out <test><here> from <test><here> and not just <test> as you might expect. You're also looking for <*tr*>, so you're looking for things like <<<trrrr>, the way to get around this is to put the * in square brackets: [*] or escape it (usually using a backslash). Square brackets means 'any of the characters in the brackets', so [aeiou*]* will match a*aaa, aei, uo, but not abc. any clearer? I've found that one of the better RE help files was the one that came with Textpad (go edit->find and click help), but the man pages for grep aren't bad, either. cheers, martin kemp > -----Original Message----- > From: OoCobra97@aol.com [mailto:OoCobra97@aol.com] > Sent: 07 August 2001 7:52 > To: php-windows@lists.php.net > Subject: Problem > > > Ok, first, I want to ask what mailing list should I mail for a scripting > question? Ive been on this list for about 6 months now, And i > dont recall > seeing to many script questions. > > 2nd, Im having a problem with the eregi command again (if you remember my > e-mail from yesterday). Heres the problem, I can find a match for what I > want, but it wont get the rest of the lines if theres a return in > them, such > as the following: > (commands have * inside of the brackets for people with HTML > mail, such as > myself) > > <*tr*><*td*>1) Name here<*/td*> > <*td align=right*>Results Here<*/td*> > <*td align=right*>Result Time Here<*/td*> > <*td align=right*>Average Time Here<*/td><*/tr*> > > If i use just the <*tr*><*td*>1) (.*)to search for, it will just > return the > Name Here part, > If I use <*td*><*td*>1)(.*)<*/td*><*/tr*> to search for it, it > wont return > anything? If anyone has any ideas, or can pont me in the right > direction, I > would appreciate it. > > ~Jeff >

« previous php.windows (#8696) next »