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 60687a0 commit a685310
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions RegEx/Unix/Mount.regex.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Matches a Unix Mount
(?m)^(?<Device>\S+) # Which is: A line start, followed by the device,
\s+ # followed by space,
(?:on\s)? # and possibly, the word 'on',
(?<MountPoint>\S+) # followed by the MountPoint,
\s+ # followed by space,
(?:type\s)? # and possibly, the word 'type',
(?<FileSystem>\S+) # followed by the FileSystem,
\s+ # followed by space.
(?:\()? # Then, optionally, an open parenthesis.
(?<MountOptions> # Each mount option
(?:[\s\,]? # will be separated by an optional comma
(?>((?<DumpFrequency>\d) # If the mount option started with a digit, it is the DumpFrequency
\s(?<PassNumber>\d) # and it will be followed by the PassNumber
|(?<MountOption>[^\s\,\)]+) # Otherwise, the mount option is anything until the next comma or )
))\)?){1,})(?:.*$) # Then match until the end of the line.
(?m)^(?<Device>\S+) # Which is: A line start, followed by the device,
\s+ # followed by space,
(?:on\s)? # and possibly, the word 'on',
(?<MountPoint>\S+) # followed by the MountPoint,
\s+ # followed by space,
(?:type\s)? # and possibly, the word 'type',
(?<FileSystem>\S+) # followed by the FileSystem,
\s+ # followed by space.
(?:\()? # Then, optionally, an open parenthesis.
(?<MountOptions> # Each mount option
(?:[\s\,]? # will be separated by an optional comma
(?>
(?<DumpFrequency>\d) # If the mount option started with a digit, it is the DumpFrequency
\s(?<PassNumber>\d) # and it will be followed by the PassNumber
|
(?<MountOption>[^\s\,\)]+) # Otherwise, the mount option is anything until the next comma or )
)\)?){1,})(?:.*$) # Then match until the end of the line.

0 comments on commit a685310

Please sign in to comment.