diff --git a/main.go b/main.go index 5513aab..bc96293 100644 --- a/main.go +++ b/main.go @@ -67,7 +67,7 @@ func shuntingYard(re string) []postfixNode { } continue } - if re_runes[i] != '(' && re_runes[i] != '|' && re_runes[i] != '\\' { + if (re_runes[i] != '(' && re_runes[i] != '|' && re_runes[i] != '\\') || (i > 0 && re_runes[i-1] == '\\') { // Every character should be concatenated if it is escaped if i < len(re_runes)-1 { if re_runes[i+1] != '|' && re_runes[i+1] != '*' && re_runes[i+1] != '+' && re_runes[i+1] != '?' && re_runes[i+1] != ')' { re_postfix = append(re_postfix, CONCAT)