Skip to content

Commit

Permalink
fix: Generating .regex.txt files ( Fixes #235, Fixes #236 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage authored and James Brundage committed Sep 22, 2024
1 parent ffb2393 commit 60687a0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions RegEx/Unix/Conf_Line.regex.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Matches Lines in a .conf or .ini file.
(?m) # Set Multiline mode
(?m) # Set Multiline mode
# A Configuration line can either be a comment line, a blank line, or a line with a value
(^[\;\#](?<Comment>(?:.|\s){0,}?(?=\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?(?<Delimeter>[\=\:]) # Followed by an equals or colon (surrounded by optional whitespace)
\s?(?<Value>(?:.|\s){0,}?(?=\z|$)) # Anything until the end of line is the value
|(?<Line>^.$))
(?:^[\;\#](?<Comment>(?:.|\s){0,}?(?=\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?(?<Delimeter>[\=\:]) # Followed by an equals or colon (surrounded by optional whitespace)
\s?(?<Value>(?:.|\s){0,}?(?=\z|$)) # Anything until the end of line is the value
|
(?<Line>^.$))

0 comments on commit 60687a0

Please sign in to comment.