July 20th, 2000, 07:19 PM
I'm reading "Professional PHP Programming," and in it, the authors say that slash-dot, (.), represents a literal dot, ...but one of the book's examples uses slash-slash-dot (.).
Can someone explain this discrepancy? (I'm new to RE's.)
here's the example for validating an email address: ^.+@.+..+$
why isn't it ^.+@.+..+$
July 20th, 2000, 08:06 PM
One more thing,
I'm parsing a page (that's stored as a string) so I'll just end up with the links on the page. Using (<[aA].+/[aA]> ) gets me the first occurance of <a href...> and the last occurance of </a>.
I want to each individual link by itself.
Anyone know how to fix this code? I've been toying around w/ it and haven't gotten it yet.
July 20th, 2000, 11:41 PM
Well, the backslash character is used to "escape" any sepcial meta-characters. I guess that means that someone wants to find the backslash character literally...
July 21st, 2000, 12:26 AM
hehe - been there - its a pain innit! -
you first have to explode() or split() the string, so each element contains just one link - then run the regex, I usually explode by "a>" leaving me "</" for the regex search
See this brief tut' at http://www.firepages.com.au/news.htm it shows pretty much the same thing.
PS if you use eregi() you can forget having to test for 'a' and 'A'