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 bbc1156 commit e4eaec6
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions RegEx/Git/Diff.regex.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# Matches Output from git diff
(?m)(?<Git_DiffHeader>
(?m)^diff # diff line start
\s--git\s # whitespace, then --git, then whitespace
(?<From>\S+) # From
\s # Whitespace
(?<To>\S+) # To
(?<ExtendedHeader>(?:.|\s){0,}?(?=\z|^index)) # Until 'index'
^index\s # Index Line Start
(?<FromHash>\w+) # FromHash
\.{2,2} # DotDot
(?<ToHash>\w+) # ToHash
\s(?<Mode>\w+) # FileMode
(?:.|\s){0,}?(?=\z|^---) # UntilDashLine
\-{3,3}\s # DashLineAndWhitespace
(?<FromUnified>\S+) # FromUnified
\s+\+{3,3}\s # PlusLineAndWhitespace
(?<ToUnified>\S+) # ToUnified
\s
(?m)^diff # diff line start
\s--git\s # whitespace, then --git, then whitespace
(?<From>\S+) # From
\s # Whitespace
(?<To>\S+) # To
(?<ExtendedHeader>(?:.|\s){0,}?(?=\z|^index\s{1})) # Until 'index'

)
(?<Git_DiffRanges>(?:.|\s){0,}?(?=\z|^diff))

0 comments on commit e4eaec6

Please sign in to comment.