Re: Self-recognizing programs and regular expressions

2005-03-08 Thread Karsten Sperling
This is as far as I got: ^(?=.{65}Q\\1E\\\)\z)(\Q^(?=.{65}Q\\1E\\\)\z)(\E)\\Q\1\\E\) It is a true inequ of sorts. However, it uses \Q, which is a quoting construct, not a regex construct. So it doesn't work as $x =~ /$x/, only as $x =~ eval(qr/$x/): chomp(my $x = 'EOF');

Re: Self-recognizing programs and regular expressions

2005-03-08 Thread Karsten Sperling
Here's one without \Q, which I'm fairly certain is score 1:

Re: Self-recognizing programs and regular expressions

2005-03-07 Thread Karsten Sperling
On Monday, March 7, 2005, Jasvir Nagra wrote: The par entry is: Entry Score ^.{6}$ 255^6 Strictly speaking that would be 2 * 255^6 because of the optional trailing newline. Still, it's better than ^.{7}\z with 255^7.

Re[2]: P2P in 15 lines

2004-12-16 Thread Karsten Sperling
On Thursday, December 16, 2004, Brad Greenlee wrote: The original python version never actually sends the password in any form; I believe it just uses it to hash the server url, which gets passed as a parameter. The server then just hashes its own url with its password to see if they match.

Re: tough regex problem

2004-09-17 Thread Karsten Sperling
How about /.*?$sep|.+|^\z/sg Seems to work alright for empty file as well as incomplete lines, without producing bogus empty lines. - Karsten

Re: graphing the sexchart

2002-01-04 Thread Karsten Sperling
I couldn't figure out a Perl-ish way of parsing it, resorting to putting it all in a big 2D array and scurrying around it. With lots of consistency checking it takes about 5s to run on my 1.6GHz box (yikes). The problem is very similar to PCB tracks in electronics. The tracks are the

Re: Santa Hole 4 (mid.pl) Post Mortem

2001-12-07 Thread Karsten Sperling
Piers and Karsten both found shorter multi-line solutions: Piers: Grr... that one line rule is *so* silly: #!/usr/bin/perl -p0 $_=$1while/ (.+)^/ms Karsten: #!/usr/bin/perl -p0 $_=$1while/ (.* )./s Both of these are really 25 chars (counting the \n's within the program as one char

Re: The Santa Claus Golf Apocalypse

2001-12-06 Thread Karsten Sperling
*** Eugene van der Pijll: 89 (11 19 13 25 21) *** --- rev.pl - #!/usr/bin/perl -p $\=$_.$\}{ That's just *beautiful*. I just couldn't see past 'print reverse'. I've been wondering for hours now how he keeps $_ from being destroyed by the last