Skip to content

Commit

Permalink
;test: import: update matchgroup functest for #2158
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Dowland <[email protected]>
  • Loading branch information
jmtd committed Feb 28, 2024
1 parent ac79709 commit 6fa704f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hledger/test/import/match.rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ fields _, date, _, description, account1, amount, _
if %account1 liabilities:jon:(.*)
# ...and interpolated into field assignments (real-life use-case #2)
account1 \1

# This should match, as should the next block. Both blocks assign
# to comment1, so this block should be a no-op. It's here to test
# the match group numbering between blocks are not conflated (#2158).
if (Zettle)
comment1 ignore

# checking brackets in a record matcher are captured, including
# nesting...
if Zettle.*(Robert W. (Bell)).*£
# ... and the interpolation token numerical offset is local to
# this match group; and the token is interpolated into surrounding
# text
comment1 Bell=\2.
# Match the YYY-MM of a date field and warp the posting date, useful
# Match the YYYY-MM of a date field and warp the posting date, useful
# for credit cards (real-life use-case #1))
if %date (....-..)-..
comment2 date:\1-01

0 comments on commit 6fa704f

Please sign in to comment.