diff --git a/misc.go b/misc.go index 20443a7..5028a80 100644 --- a/misc.go +++ b/misc.go @@ -2,7 +2,6 @@ package main import ( "slices" - "unicode" ) var whitespaceChars = []rune{' ', '\t', '\n'} @@ -33,8 +32,10 @@ func isWordBoundary(str []rune, idx int) bool { return wbounded } -func isAlphaNum(c rune) bool { - return unicode.IsLetter(c) || unicode.IsNumber(c) +func isNormalChar(c rune) bool { + specialChars := []rune(`?*\^${}()+|[].~`) + specialChars = append(specialChars, LBRACKET, RBRACKET) + return !slices.Contains(specialChars, c) } func assert(cond bool) {