On Mon, Mar 07, 2005 at 11:05:15PM +0000, Ton Hospel wrote: > Ah, the idea seems salvagable, but less elegant: > > this sequence is self matching: > ^ > ^\^ > ^\^\\\^ > ^\^\\\^\\\\\\\^ > .... > > so an infinite sequence of ^ with 2**n-1 \ after the n-th ^
This is also self matching:
\A\\A\\\\A\\\\\\\\A....
with 2**(n-1) \s before the n-th A.
Years ago, while I was still writing JAPHs, I was looking for a regex
matching itself - and nothing but itself (regexes that match themselves,
and also other strings are easy and IMO, not interesting), but I never
found one. The search wasn't entirely fruitless, it did lead to:
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
But that's a far cry from what I wanted to find.
Abigail
pgpMQ4E8ejcxP.pgp
Description: PGP signature
