From 68a7748988f6a6381f248efa7d52118181e605ff Mon Sep 17 00:00:00 2001 From: James Brundage Date: Sun, 22 Sep 2024 05:34:04 +0000 Subject: [PATCH] fix: Generating .regex.txt files ( Fixes #235, Fixes #236 ) --- RegEx/JavaScript/Class.regex.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 RegEx/JavaScript/Class.regex.txt diff --git a/RegEx/JavaScript/Class.regex.txt b/RegEx/JavaScript/Class.regex.txt new file mode 100644 index 0000000..62abc98 --- /dev/null +++ b/RegEx/JavaScript/Class.regex.txt @@ -0,0 +1,17 @@ +# Matches a JavaScript Class +class # Class Keyword +\s+ # Whitespace +(?\S){1,} # Class Name +\s{0,} # Optional whitespace +(?[^\{]{0,})\s{0,} # Optional whitespace +(?(? +\{ # An open { +(?> # Followed by... + [^\{\}]+| # any number of non-bracket character OR + \{(?)| # an open curly bracket (in which case increment depth) OR + \}(?<-Depth>) # a closed curly bracket (in which case decrement depth) +)*?(?(Depth)(?!)) # until depth is 0. +\} # followed by a } +) +) # The class body +