halfbaked has asked for the wisdom of the Perl Monks concerning the following question:
I need the regular expression to stop when it hits white space, in this example not including the hashtags (#seattle #seattlenews).#!/usr/bin/perl $tweet = 'Mayor Nickels leads the pack as Seattle campaign contributio +ns break $1 million mark http://tinyurl.com/ckpxmu #seattle #seattlen +ews'; $_ = $tweet; s/(http.*)/<a href=\"\1\">\1<\/a>/; print $_ . "\n";
|
|---|