in reply to grabbing link and 3 regexes to save HTML to disk
Hello Discipulus,
I don’t have an answer to your question, sorry, just a few comments on syntax:
The comma operator has a lower precedence than ||, so a line such as:
open RENDER, "> $ENV{TEMP}/_temp.html" || die "unable to write to %TEM +P%\\_temp.html";
actually parses as:
open RENDER, ( "> $ENV{TEMP}/_temp.html" || die "unable to write to %T +EMP%\\_temp.html" );
which is not what you want. Either change || to the lower-precedence or, or put the arguments to open into parentheses.
In a regex, (:?X) captures X preceded by zero or one literal colons. For clustering (which is non-capturing), you need (?:X).
You can avoid “leaning toothpick syndrome” by using regex delimiters other than the forward slash:
s{src="([^"]*)/}{src="./_temp_files/}gm
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: grabbing link and 3 regexes to save HTML to disk
by Discipulus (Canon) on Mar 22, 2013 at 20:41 UTC |