I doubt it has anything to do with a + character, more likely it's to do with the fact that .* is greedy and you've got two links on the same line, as Corion said.

Yes, I realize that Perl regex is not the way to go to find links.

Correct! Sorry, but in regards to "my method works": it's not really working, though. And even if you fix this one issue with this one input, the next problem will certainly pop up - see this node for how complex parsing HTML gets*. In this case, there's a very well established module for that, HTML::LinkExtor. Mojo::DOM also works:

use Mojo::DOM; my $dom = Mojo::DOM->new(<<'END_HTML'); <a href="https://www.example.com/foodbanks/a">a</a> <a href="https://w +ww.example.com/foodbanks/b">b</a> <a href="https://www.example.com/foodbanks/c">c</a> END_HTML $dom->find('a[href]')->each(sub { print "$_ / ",$_->{href}," / ",$_->all_text,"\n"; });

Edited second paragraph.

* Update: Why a regex *really* isn't good enough for HTML and XML, even for "simple" tasks


In reply to Re: If I'm matching a pattern wy does a + sign make things crazy? (updated) by haukex
in thread If I'm matching a pattern wy does a + sign make things crazy? by SergioQ

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.