refactored and renamed NSString#scan to match