in reply to replacing variable in regex - probs with special chars?
The obvious limitation over the original solution is that it doesn't allow one to loop, but perhaps this would work?$source =~ s/(\[link title:(.*?)\](.*?)\[\/link])/<a href='$3'>$2<\/a> +/gi;
while ($source =~ s/\G(\[link title:(.*?)\](.*?)\[\/link])/<a href='$3 +'>$2<\/a>/i) { print "complete: $1\ntitle: $2\nurl: $3\n"; }
--
integral, resident of freenode's #perl
|
|---|