in reply to replace all spaces within anglebrackets with underscores
The code looks like this:
It turns an address like mjd-perl-pause@www.plover.com into mjd-perl-pause-id-iws+bx9zvct@www.plover.com, unless the address is a mailing list subscribe address such as mjd-perl-memoize-subscribe@plover.com.s{\b(mjd[-\w]*) \@ ( (?:\w+\.)? plover\.com \b) } {($a,$b) = ($1,$2); $a =~ m{-subscribe$} ? "$a\@$b" : "$a-id-$id\@$b" }gex;
This page has a detailed description of a similar solution to a problem, but if you read it, be sure to start here instead and read backwards up the page. The end result:
s{(.*?)(\`([^\']*)\')} {$pos += length $1; my $length = length $2; print ((' ' x ($pos)), "^", (' ' x ($length-2)), "^ ? "); my $r = lc <STDIN>; $pos += $length; (substr($r,0,1) eq 'n') ? $& : "$1<tt>$3</tt>" }eg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: replace all spaces within anglebrackets with underscores
by KM (Priest) on Jan 05, 2001 at 06:39 UTC |