J
Jason C
I know better than to work late at night, but sometimes it just can't be helped 
I'm doing a simple s///, converting "www." to "http://www." when "www." occurs without a preceding "http://". Here's what I'm doing:
$text = "www.example.com";
$text =~ s#[^(http://)]www\.#http://www\.#gi;
print $text;
If $text is this, though:
$text = "<div>www.example.com</div>";
the regex is catching the > in <div>, printing:
<divhttp://www.example.com</div>
Where am I screwing up?
I'm doing a simple s///, converting "www." to "http://www." when "www." occurs without a preceding "http://". Here's what I'm doing:
$text = "www.example.com";
$text =~ s#[^(http://)]www\.#http://www\.#gi;
print $text;
If $text is this, though:
$text = "<div>www.example.com</div>";
the regex is catching the > in <div>, printing:
<divhttp://www.example.com</div>
Where am I screwing up?