             var combinator: String = ""
             
             if let result = matchBlank(str) {
-                str = str.substring(from: str.index(str.startIndex, offsetBy: result.range.length))
+                str = String(str[str.index(str.startIndex, offsetBy: result.range.length)..<str.endIndex])
             }
             
             // element

    if let result = matchAttrN(str) {
        var one = substringWithRangeAtIndex(result, str: str, at: 1)
        if skip {
            str = str.substring(from: str.characters.index(str.startIndex, offsetBy: result.range.length))
        }
        
        if let attr = getAttribute(&one, skip: false) {

                                  substringWithRangeAtIndex(result, str: str, at: 3).replacingOccurrences(of: "[\'\"](.*)[\'\"]", with: "$1", options: .regularExpression, range: nil))

        if skip {
            str = String(str[str.index(str.startIndex, offsetBy: result.range.length)..<str.endIndex])
        }
        
        switch expr {
