Re: A little text file munging golf on the list

Andrew Savige <[email protected]>
Newsgroups gmane.comp.lang.perl.golf
Message-ID <[email protected]>
En op 16 maart 2002 sprak Rick Klement:
> And one without that ugly \S :
>
> s/^((.+ ).+)\n\2/$1 /m&&redo

That looks fine to me. I noticed Bass sprak on 13 maart:

> #!perl -p0
> s#^(\S* )(.*)\n\1#$1$2 #m&&redo
> 
> If the input contains no duplicate lines, the "\S*" can be replaced >
with ".*".

Yet ".*" seems to work fine with duplicate lines. I can't find any
test data where "\S*" behaves differently to ".*".

/-\


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.