Concatenate every character if it is escaped

master
Aadhavan Srinivasan 2 months ago
parent d8299294ed
commit a66e8f1c08

@ -67,7 +67,7 @@ func shuntingYard(re string) []postfixNode {
} }
continue 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 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] != ')' { 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) re_postfix = append(re_postfix, CONCAT)

Loading…
Cancel
Save