From 692de2a32b8a23e96fb8a945b1c70136cdcc1053 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Fri, 31 Jan 2025 09:26:21 -0500 Subject: [PATCH] Added lookarounds and numeric ranges to documentation --- regex/doc.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/regex/doc.go b/regex/doc.go index e800726..bef77ec 100644 --- a/regex/doc.go +++ b/regex/doc.go @@ -84,6 +84,17 @@ Assertions: \b Match at a word boundary (a word character followed by a non-word character, or vice-versa) \B Match at a non-word boundary (a word character followed by a word character, or vice-versa) +Lookarounds: + + x(?=y) Positive lookahead - Match x if followed by y + x(?!y) Negative lookahead - Match x if NOT followed by y + (?<=x)y Positive lookbehind - Match y if preceded by x + (? Match any number from x to y (inclusive) (x and y must be positive numbers) + # Flags Flags are used to change the behavior of the engine. None of them are enabled by default. They are passed as variadic arguments to [Compile].