« Selling by phone and Skype - our policy | Main | Three sets of twins »

January 31, 2007

PHP Regular expression to extrtact link and text

How many special characters can you realistically use in a regular expression without a single space, letter or digit? Here's one I wrote yesterday.

eregi('href="([^"]+)"[^>]*>([^<]+)',$line,$parts);

Far fetched example? No - it's part of a link checker that picks out a URL and the text that appears on the link ...

Posted by gje at January 31, 2007 05:57 AM

Comments

Post a comment




Remember Me?


Well House Consultants Ltd. Copyright 2008