in reply to Substituting with match containing newline and space characters
Use a proper HTML handling module. For example, XML::XSH2, a wrapper around XML::LibXML:
open :F html file.html ; for //input[@type="checkbox"] { $attr = @*[xsh:matches(.,'\[0\]$')] ; $name = xsh:match($attr, '.*\.(.*)\[0\]$') ; if $name set @label $name ; } save :F html :b ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Substituting with match containing newline and space characters
by MorayJ (Beadle) on Mar 30, 2015 at 13:43 UTC |