Switched a few lines to use regex instead of NSString rangeOfString