in reply to RegExp not working!
#!/usr/bin/perl use strict; use 5.016; # 1084488 my $line = '<td align="left"><b>A</b> - Tilt: 19° - Segments: 1(7 +2-93)</td>'; if ($line =~ /<td align="left"><b>A<\/b>\s+-\s+Tilt:\s+\d+&#\d+;\s+-\s ++Segments:\s+(.*?)<\/td>/) { say 'yep, good match'; say $1; } else { say 'boo'; }
Note that the literal parentheses around the range 72-93 need to be escaped; otherwise they set up a capture. Conversely, you need to parenthesize the whole regex expression (i.e., between the regex delimiters) to capture, as you asked, the whole line... or, if you don't want the html (your OP indicated that's the case) put pairs of capturing parentheses around what you do want (to skip over the closing </b> and to eliminate the closing </td>) in which case, your <c>.+?<c> to match the segment value will need to be more specific or otherwise modified.
Updated by putting that last para, that got lost somewhere :-(, back in the node, and adding the observation re skipping the html.
check Ln42!
|
|---|