title: Getting img url from RSS feed swift
body: <p>I want to be able to retrieve the img url from a piece of string. </p>
  
  <p>Here's a sample of the img URL that I'm trying to retrieve:</p>
  
  <pre><code>&lt;p&gt;&lt;img width="357" height="500" src="http://images.sgcafe.net/2015/05/OVA1-357x500.jpg" class="attachment-         medium wp-post-image" alt="OVA1" /&gt;
  </code></pre>
  
  <p>My current implemention is crashing at <code>textCheck</code> which says its <code>NIL</code>. I looked over at the Objective C solution on stackoverflow and implemented it in swift, but it doesn't seem to work.</p>
  
  <pre><code>var elementString = item.summary
  var regex: NSRegularExpression = NSRegularExpression(pattern: "img     src=\"([^\"]*)\"", options: .CaseInsensitive, error: nil)!
  let range = NSMakeRange(0, count(elementString))
  var textCheck = regex.firstMatchInString(elementString, options: nil, range: range)!
  let text = (elementString as NSString).substringWithRange(textCheck.rangeAtIndex(1))
  </code></pre>