<div dir="ltr">Not the most efficient, but you can just always remove and add them back:<div><br></div><div><div>#!/usr/bin/perl</div><div><br></div><div>use strict;</div><div><br></div><div>while (my $line = <DATA>) {</div>
<div><span class="" style="white-space:pre">    </span>$line =~ s/^-?(.+?):?$/-$1:/;</div><div><span class="" style="white-space:pre">      </span>print $line;</div><div>}</div><div><br></div><div>__DATA__</div><div>stuff</div><div>
-stuff</div><div>stuff:</div><div>-stuff:</div></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div>--</div><a href="mailto:dave.s.doyle@gmail.com" target="_blank">dave.s.doyle@gmail.com</a></div>

<br><br><div class="gmail_quote">On 19 April 2013 10:58, Fulko Hew <span dir="ltr"><<a href="mailto:fulko.hew@gmail.com" target="_blank">fulko.hew@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font face="courier new,monospace">The subject line may not say it properly, but I need<br>a _single_ (because of other constraints) s/// statement<br>that effectively performs the following:<br><br>If the string doesn't start with a hyphen and end with colon,<br>


then I want them added.<br><br>ie:<br><br>stuff   => -stuff:<br>-stuff  => -stuff:<br>stuff:  => -stuff:<br>-stuff: => -stuff:<br></font>
<br>_______________________________________________<br>
toronto-pm mailing list<br>
<a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/toronto-pm" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
<br></blockquote></div><br></div>