I downvoted the OP (belatedly). Here's why:

"Among other expressions, I have tried: m/subsid(.*)(">)/" ... and not even in code tags, at that.

Missing from your regex: modifiers to make it case-insentive and multi-line... and context (even if simplified) to make it easy for us to spot non-regex errors.

The code in your narrative doesn't even come close to doing what you say you want. It's time for you to do some reading -- in this case, perlretut and friends -- and stop typing in poorly constructed questions every time you face an issue.

Also, you've posted too much data: if you've stated your intention precisely, then there's no need for the entire html for Row 9 of the table. This is a very poor post, even given the low quality of your recent nodes.

So here's a crummy example (see much better suggestions above re modules) constructed solely to demonstrate that if you're going down the (fool's) path of trying to parse html with a regex, it can be done. It's so bad an example that I feel free to offer it to a gimmé-artist:

#!/usr/bin/perl use strict; use warnings; my @lines = <DATA>; for my $line(@lines) { print "| $line |"; if ($line =~ /(<a href.+<\/a>)/) { # note, no need to capture the + whole of row 9 print "$1 \n\n"; } else { print "Crummy regex\n" } } __DATA__ <td scope="row">9</td> <td scope="row">SUBSIDIARIES OF THE REGISTRANT</td> <td scope="row"><a href="/Archives/edgar/data/1050122/000 +092735601000365/0000927356-01-000365-0009.txt">0009.txt</a></td> <td scope="row">EX-21.1</td></> And here's execution: <c>C:>wrkrbeejunk.pl | <td scope="row">9</td> |Crummy regex | <td scope="row">SUBSIDIARIES OF THE REGISTRANT</td> |Crummy regex | <td scope="row"><a href="/Archives/edgar/data/1050122/0 +00092735601000365/0000927356-01-000365-0009.txt">0009.txt</a></td> |<a href="/Archives/edgar/data/1050122/000092735601000365/0000927356- +01-000365-0009.txt">0009.txt</a> | <td scope="row">EX-21.1</td> |Crummy regex C:\>

Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
  1. code
  2. verbatim error and/or warning messages
  3. a coherent explanation of what "doesn't work actually means.

In reply to Re: REGEX for url by ww
in thread REGEX for url by wrkrbeee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.