title: The dollar sign in Python regular expressions
body: <p>I am working on a small program with the purpose of findings website URLs ( it is the simplest you could possibly imagine though ). Here's how a relevant portion of it looks like :</p>
  <pre><code>webURLregex = re.compile(r'''(
     (https://|http://)
     ([a-zA-Z0-9.%+\\/_-]+)
     ([a-zA-Z0-9%+\\/_-]$)
     )''',re.VERBOSE)
  </code></pre>
  <p>Despite the ''findall'' method I used to search the pasted string, the program gives me only one result, despite the copied text consisting of over 5 URLs.
  When I delete the dollar sign, it works properly.</p>
  <p>I do understand that the dollar sign is unnecessary because the aim of the line it is placed within is only to not match the pasted string's last character if it happens to be a comma or a dot, but I thought the dollar sign could not change the output at all, and apparently it did.</p>
  <p>Out of six results I got by running the without-dollar-sign program, only one remains ( for an unknown reasons considering they all look the same schematically ) when I add the dollar sign. I tried adding it right after the closing bracket of the parentheses as well, and the output is one string as well.</p>
  <p>Any idea about how and why this occurs would be appreciated.</p>
  <p>Thanks in advance.</p>