The problem with using the + quantifier is that the entire regex will not match a line that has an opening <div tag but no closing </div tag on the same line. For example, your modification will not match the following:
my $line = "<div id=\"roguebin-response-35911\" class=\"bin-response\" +>";
I was hoping to write a single regex that will handle both cases, i.e. an opening <div tag with a closing </div tag on the same line, and an opening <div tag with no closing </div tag on the same line. I understand a built in parser would make this task easier, but I would still like to understand how to write a single regex that would capture both of these cases.
In reply to Re^2: problem with optional capture group
by Special_K
in thread problem with optional capture group
by Special_K
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |