in reply to Substituting with match containing newline and space characters

You aren't trying to parse HTML with regular expressions, are you?

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 ;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Substituting with match containing newline and space characters
  • Download Code

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
    Unfortunately, yes...I just wanted to be quick and dirty and all I've achieved so far is dirty. Thanks for the example...may have to turn this ship around.