fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. while (<>)
  5. {
  6. s/([^0-9]|^)-+([^0-9]|$)/$1 $2/g;
  7.  
  8. }
  9.  
Success #stdin #stdout 0s 6044KB
stdin
2014-05-01
this-and
this-and-that
this-and-that-and-that-too
-what-about-this
or-this-
and--these
2015-01-01
stdout
2014-05-01
this and
this and that
this and that and that too
 what about this
or this 
and these
2015-01-01