From 76157af2b801163fd418b4051367b6dfe38d5ebf Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Tue, 29 Oct 2024 00:25:30 -0400 Subject: [PATCH] Wrote function to generate rune slice representing valid dot metacharacter values --- misc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/misc.go b/misc.go index 8f4f904..2520b15 100644 --- a/misc.go +++ b/misc.go @@ -5,6 +5,16 @@ import ( "unicode" ) +func dotCharacters() []rune { // Returns all possible characters represented by the dot metacharacter + start := 0x0020 + end := 0x007E + to_return := make([]rune, (end-start)+1) + for i := start; i <= end; i++ { + to_return = append(to_return, rune(i)) + } + return to_return +} + func isAlphaNum(c rune) bool { return unicode.IsLetter(c) || unicode.IsNumber(c) }