title: Converting Script from Powershell to Python-Regex Not Working as Expected
body: <p>I'm trying to convert a Powershell Script to a python script.  I was going to use a Shell script for the ease of use for grep and curl, but I decided on python for the ease of if statements.
  This is the Powershell code that I am trying to convert:</p>
  
  <p>Powershell code (works great):</p>
  
  <pre><code>$ReturnedRegExData = SearchStringAll -StringToSearch $Data -RegEx $ImgURLRegex 
  
  if ($ReturnedRegExData) #Check Existance of Matches
  {
      foreach ($Image in $ReturnedRegExImageData) #Run Through all Matches
      #Can then get the result from the group of results and run through them 1 at a time via $Image
  }
  else
  {
      #exit
  }
  </code></pre>
  
  <p>This is my attempt at Python, not working too good</p>
  
  <pre><code>ReturnedRegExData = re.findall($ImgURLRegex , $Data)
  
  if ReturnedRegExImageData: #Check existance of Matches (Works)
      print "found"
  else:
      sys.stderr.write("Error finding Regex \r\n")
      return
  
  $For Loop running through results
  </code></pre>
  
  <p>re.search worked with this print ReturnedRegExImageData.group(0), but I want to find all matches, and having an extremely hard time replicating foreach ($Image in $ReturnedRegExImageData) this line:
  I've tried messing around with for Image in ReturnedRegExData and a for loop from 0 to len(ReturnedRegExData), but they don't return valid data.  I know Python is supposed to be simple coding, but I am having an extremely hard time of dealing with it.</p>
  
  <p>I've read similar posts for .match, /search and .findall, and they all go over the searching part, but nothing goes over how to get the results in a useful format.  I have looked through the manual, but I'm having a hard time deciphering that as well.</p>
  
  <p>How can I run through the results that findall found, whether returns 0, 1 or more results.  0 Should be covered by the if statement.</p>
  
  <p>Thanks for any help you can provide.</p>
  
  <p>J</p>