From 445a7247f8459df142e5f527bf753470709a01ab Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Tue, 29 Oct 2024 10:04:36 -0400 Subject: [PATCH] Defined variables to provide ranges of characters for metacharacters --- misc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc.go b/misc.go index 2520b15..1206a57 100644 --- a/misc.go +++ b/misc.go @@ -5,7 +5,11 @@ import ( "unicode" ) -func dotCharacters() []rune { // Returns all possible characters represented by the dot metacharacter +var whitespaceChars = []rune{' ', '\t', '\n'} +var digitChars = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} +var wordChars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_") + +func dotChars() []rune { // Returns all possible characters represented by the dot metacharacter - this is too tedious to define as a variable, which is why it is a function start := 0x0020 end := 0x007E to_return := make([]rune, (end-start)+1)