-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathConf_File.regex.txt
More file actions
15 lines (15 loc) · 735 Bytes
/
Copy pathConf_File.regex.txt
File metadata and controls
15 lines (15 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Matches Configuraiton File Content
(?>((?<Unix_Conf_Section>
(?m)\[(?<SectionName>(?:.|\s)+?(?=\z|]))(?<SectionLines>(?:.|\s)+?(?=\z|^\[))
)
|(?<Unix_Conf_Line>
(?m) # Set Multiline mode
# A Configuration line can either be a comment line, a blank line, or a line with a value
(^[\;\#](?<Comment>(?:.|\s)+?(?=\z|$)) # Lines that start with ; or are comments
|^\s+$ # Blank lines will also match, but not be captured
|(?<Key>^[\w\s\.\-]+) # Otherwise, the first word is the name
\s?[\=\:] # Followed by an equals or colon (surrounded by optional whitespace)
\s?(?<Value>(?:.|\s)+?(?=\z|$)) # Anything until the end of line is the value
)
)
)+)