-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCustomization.regex.txt
24 lines (24 loc) · 1.15 KB
/
Customization.regex.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Matches Potential Open SCAD Customizations
(?m)^(?<Name>\w+) # Optional Whitespace
\s{0,} # Optional Whitespace
\=\s{0,} # Optional Whitespace
(?>
(?<Value>(?<NumberValue>[\d\.]+) # A numeric value
|
(?<BooleanValue>true|false) # A boolean value
|
\"(?<StringValue>(?:.|\s)*?(?<!\\)") # A string value
|
(?<ListValue>(?<BalancedBrackets>
\[ # An open bracket
(?> # Followed by...
[^\[\]]+| # any number of non-bracket character OR
\[(?<Depth>)| # an open bracket (in which case increment depth) OR
\](?<-Depth>) # a closed bracket (in which case decrement depth)
)*(?(Depth)(?!)) # until depth is 0.
\] # followed by a closing bracket
)
) # A List Value
))\s{0,} # Optional Whitespace
\; # Semicolon
(?<RestOfLine>.*$)