title: How to get a regex to start from the beginning of a string
body: <p>This is an oddball issue I've encountered (and probably have seen before but never paid attention to).</p>
  
  <p>Here's the gist of the code:</p>
  
  <pre><code>my $url = 'http://twitter.com/' . $handle;
  my $page = get($url);
  
  if($page =~ m/Web&lt;\/span&gt;\s*&lt;a href=\"(.+?)\"/gi) {
      $website = $1;
  }
  
  if($page =~ m/follower_count\" class=\"stats_count numeric\"&gt;(.+?)\s*&lt;/g) {
      $num_followers = $1;
  }
  </code></pre>
  
  <p>It gets a twitter url and does a bit of regex to capture the # of followers and the website of the user. This code actually works fine. But when you switch the order and search for the website AFTER you search for follower, website comes up empty. As it turns out, when you regex a string, it seems to sort of save the location of where that last match was made. In the html, the follower count comes up after the website display. If you do the follower count regex first, it's like it starts up the website regex where the follower count left off (like an index reference to the string).</p>
  
  <p>What has me baffled is that i have the "g" operator at the end, signifying "global", as in "search the string globally... from the beginning".</p>
  
  <p>Am I missing something here? I can't seem to figure out why it's resuming the last regex position on the string (if that makes sense).</p>