Re: Regex Help for URL's

From: Date: Wed, 17 May 2006 17:41:42 +0000
Subject: Re: Regex Help for URL's
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-236356@lists.php.net to get a copy of this message
This one time, at band camp, "Robert Samuel White" <rsw@rswfire.com> wrote: > Don't be rude. I've already don't all of that. Nothing came up. I've > been > programming for 20 years (since I was 11 years old) so I'm not a slacker > when it comes to learning new things, however, I have always found regular > expressions to be extremely difficult. Someone here might have the answer I > need, and if so, I'd appreciate a response. If you don't know the answer, > don't reply. Simple enough, don't you think? Sorry, I missed most of this... From what I gather you wish to extract urls from text? if so.. function getLinks($string){ // regex to get the links preg_match_all("|http:?([^\"' >]+)|i", $string, $arrayoflinks); return $arrayoflinks; } Also check out this on line tutorial for regex geared towards PHP http://phpro.org/tutorials/Introduction-to-PHP-Regular-Expressions.html Kind regards Kevin -- "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote."

« previous php.general (#236356) next »