Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.46 KB | None | 0 0
  1. func parsePlaylist(playlistString: String) {
  2.         var regexError: NSError?
  3.         var expression = NSRegularExpression(pattern: "(https?:\\/\\/[^#]+)", options: NSRegularExpressionOptions.CaseInsensitive, error: &regexError)
  4.        
  5.         if let matches = expression?.matchesInString(playlistString, options: nil, range: NSMakeRange(0, count(playlistString))) {
  6.             for match in matches {
  7.                 println(match)
  8.             }
  9.         }
  10.  
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement