diff --git a/regex/compile.go b/regex/compile.go index ebcb318..5fa56af 100644 --- a/regex/compile.go +++ b/regex/compile.go @@ -627,7 +627,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) { case "word": // Word characters nodeToAdd, _ = newEscapedNode('w', true) // This isn't going to error, so I suppress it default: - return nil, err + return nil, fmt.Errorf("invalid POSIX character class") } chars = append(chars, nodeToAdd) i = temp_i + len(posixClass) + 2 // Skip over the class name, the closing colon and the closing bracket