in reply to search and replace question
For one, I think you'd want
's/<\?Pub fontsize="[^"]*"\?>/<!--Rem Pub Dir-->/g' ^^^^^
i.e. match anything but a double quote between the double quotes that hold the fontsize. (As the fontsize value is unlikely to contain an escaped double quote itself, this simplified approach should work reasonably well.)
The other issue with the wrapped lines not matching is simply because you're processing the file line by line (option -p), so you never have more than one line in $_ to match against (so /s won't help). Solving this in a "-p"-one-liner is rather involved... so you might want to check first whether you could maybe read the entire file into a single string instead.
|
|---|