#!/usr/bin/perl # normalize HTML use Getopt::Long; use File::Slurp; use strict; use warnings; my $force; GetOptions ("force|f"); my $stem = shift; my $_ = read_file( $stem . '.htm' ); # whitespace s/(?: |\h)+/ /mg; # preamble s{.*>HAVE ADOPTED THIS REGULATION:
\s*}{}s; # page header s{]*;top:(?:1172|1187)px;[^>]*>(?:(?!
\s*}{}mg; # headline s{]*>(?:In Title \S+, the following Section \S+ is inserted:
\s*]*>)?\'?(SECTION \S+)
((?:(?!
]*>\'?(Article \S+)
}{]*>(?:Article \S+ is replaced by the following:
\s*]*>)?\'?(Article \S+)
((?:(?!
]*>(Article \S+) is amended as follows:
}{]*>(?:paragraph \S+ is replaced by the following:
\s*)(]*>)\'?(\d+)\. }{
]*>In (Article \S+), paragraph (\S+) is replaced by the following:
\s*(]*>)\'?(\2)\. }{