From 1b44cc9300bce9f117fd135102482ff50638c650 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 13 Mar 2021 07:08:09 +0100 Subject: [PATCH] comment long regexp in usage preparation Insert whitespace and comments for readability. --- barcat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/barcat b/barcat index d4a8274..319bc32 100755 --- a/barcat +++ b/barcat @@ -81,7 +81,10 @@ GetOptions(\%opt, local $/ = undef; # slurp my $pod = readline *DATA; $pod =~ s/^=over\K/ 25/; # indent options list - $pod =~ s/^=item\ \N*\n\n\N*\n\K (?:(?:^=over.*?^=back\n)?(?!=)\N*\n)*/\n/g; + $pod =~ s{ + ^=item \h \N*\n\n \N*\n \K # first line + (?: (?: ^=over .*? ^=back\n )? (?!=) \N*\n )* + }{\n}g; # abbreviate options $pod =~ s/[.,](?=\n)//g; # trailing punctuation $pod =~ s/^=item\ \K(?=--)/____/g; # align long options # abbreviate indicators -- 2.30.0