-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|