Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Mommy, what happens to your files when you die?


devel / comp.lang.perl.misc / regex power

SubjectAuthor
o regex powerRainer Weikusat

1
regex power

<87ilrbzedq.fsf@doppelsaurus.mobileactivedefense.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=280&group=comp.lang.perl.misc#280

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.lang.perl.misc
Subject: regex power
Date: Thu, 14 Apr 2022 19:52:33 +0100
Lines: 20
Message-ID: <87ilrbzedq.fsf@doppelsaurus.mobileactivedefense.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net WjZvotMfAZxHL+zVYd3AmA/eXmP12uAps7zhNCuwN7qjf3Kh4=
Cancel-Lock: sha1:p5SxWVus6LBMTlh4T01tWeh1U4c= sha1:InHcggq5v2S+0VQKD1IOjA6HwSU=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
 by: Rainer Weikusat - Thu, 14 Apr 2022 18:52 UTC

Assuming that $chain holds the text of a usual certificate chain file,
ie, multiple certificates concatenated, the expression

$chain =~ /(.+?-----END CERTIFICATE-----\n)/gs

will return a list of individual certificates. That's equivalent to a
loop like

my (@certs, $cert);

for (split(/\n/, $chain)) {
$cert .= "$_\n";
if ($_ eq '-----END CERTIFICATE-----') {
push(@certs, $cert);
$cert = '';
}
}

without having to spell out any of the mechanics. Pretty close to "Do
what I mean!" :-)


devel / comp.lang.perl.misc / regex power

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor