Ok, one step back. We already have - conditionally compilable - PCRE library access plus POSIX regex for --adjust and --reject, switchable by --regex-type.
Why not use similar mechanisms for consistency ?
--name-filter=REGEX
The content of REGEX then depends of the --regex-type (Posix is default).
--regex-type could be extended to support sh matching (fnmatch function).
The REGEX must contain a pattern for matching and a replacement string.
As a second option, we could introduce (now or later)
--name-filter-program="program REGEX"
The 'program' answers each line it gets (the original filename) by excactly one
output line (the new filename) as long as Wget does not close the pipe.
The 'program' needs to be started only once...
I admit, that I am not an regex expert (neither PCRE nor Posix) and I do not
know, how a proper match/replace pattern would look like (e.g. what syntax or
separation character should we use ?). Experts please....
The idea of having a program "to-get-it-all", e.g. meta information plus
content via pipe and/or environment vars, should be another project whenever
the need arises (i think is not the case right now).
Regards, Tim
signature.asc
Description: This is a digitally signed message part.
