2.1. Match Literal Text
2.2. Match Nonprintable Characters
2.3. Match One of Many Characters
####
2.1. Match Literal Text
2.2. Match Nonprintable Characters
2.3. Match One of Many Characters
##
##
use Tie::File;
my $ol_file = '/Users/tony/Dropbox/perl_data/h2_numbered_list.txt';
my @ol_file_array;
tie @ol_file_array, 'Tie::File', $ol_file or die "Something is wrong here";
my $regex = qr/
(?(<\w\d))
(?>)
(?(\d\.(\d+?)\.))\s
(?(.+))
(?(\b<\/\w\d>))
/xms;
foreach (@ol_file_array) {
if ($_ =~ m/$regex/g) {
$_ =~ s/$regex/$+{tag} id="$+{text}"$+{closing_bracket}$+{ol_numbers} $+{text}$+{closing_tag}/;
}
else { # blah blah blah