From 36b009747b7df3da8c87dabfd78d69facfbc54e8 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 13 Feb 2025 20:49:54 -0500 Subject: [PATCH] Added metacharacters for lazy quantifiers --- regex/misc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/regex/misc.go b/regex/misc.go index 38b5313..da05db4 100644 --- a/regex/misc.go +++ b/regex/misc.go @@ -16,8 +16,11 @@ var rparenRune rune = 0xF0006 var nonCapLparenRune rune = 0xF0007 // Represents a non-capturing group's LPAREN var escBackslashRune rune = 0xF0008 // Represents an escaped backslash var charRangeRune rune = 0xF0009 // Represents a character range +var lazyKleeneRune rune = 0xF000A // Represents a lazy kleene star +var lazyPlusRune rune = 0xF000B // Represents a lazy plus operator +var lazyQuestionRune rune = 0xF000C // Represents a lazy question operator -var specialChars = []rune{'?', '*', '\\', '^', '$', '{', '}', '(', ')', '[', ']', '+', '|', '.', concatRune, '<', '>', lbracketRune, rbracketRune, nonCapLparenRune} +var specialChars = []rune{'?', lazyQuestionRune, '*', lazyKleeneRune, '\\', '^', '$', '{', '}', '(', ')', '[', ']', '+', lazyPlusRune, '|', '.', concatRune, '<', '>', lbracketRune, rbracketRune, nonCapLparenRune} // An interface for int and rune, which are identical type character interface {