I have a data file with the following.
Some random text here
1
2
3
13
Show:
120
items per page
I want to remove the numbers, "Show:" and the number below. So the result becomes
Some random text here
items per page
I have the following code:
my $Showing = "((\\d{1,}\\n))*Show:\\n\\d{1,}\\n";
$FileContents =~ s/$Showing//ig;
which results in the following:
Some random text here
1
2
3
items per page
It only removes one number above "Show:", I have tried a number of variations of the $Showing variable. How can I get this to work.
I have another data file with the following:
Showing 1 - 46 of 46 products
20
50
per page
With the code, this code works.
my $Showing = 'Showing.*\n((\\d{1,}\\n)*)';
$FileContents =~ s/$Showing//ig;
The difference is the numbers are below "Showing", whereas for the one that does not work the numbers are above.