Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the expr syntax explicit in the docs #2351

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions doc/ledger3.texi
Original file line number Diff line number Diff line change
Expand Up @@ -8252,34 +8252,34 @@ The amount can be any kind of amount supported by ledger,
with or without a commodity. Use this for decimal values.

@item /REGEX/
@itemx expr account =~ /REGEX/
@itemx expr "account =~ /REGEX/"
A regular expression that matches against an account's full name. If
a posting, this will match against the account affected by the
posting.

@item @@/REGEX/
@itemx expr payee =~ /REGEX/
@itemx expr "payee =~ /REGEX/"
A regular expression that matches against a transaction's payee name.

@item %/REGEX/
@itemx expr has_tag(/REGEX/)
@itemx expr has_tag('TAG')
@itemx expr "has_tag(/REGEX/)"
@itemx expr "has_tag('TAG')"
A regular expression (REGEX) or string (TAG) that checks for the tags of
a transaction.

@item expr has_meta(/REGEX/)
@itemx expr has_meta('TAG')
@item expr "has_meta(/REGEX/)"
@itemx expr "has_meta('TAG')"
A regular expression (REGEX) or string (TAG) that checks for the metadata
key of a transaction.

@item expr tag(REGEX) =~ /REGEX/
@item expr "tag(REGEX) =~ /REGEX/"
A regular expression that matches a transaction's tags against its values.

@item expr date =~ /REGEX/
@item expr "date =~ /REGEX/"
Useful for specifying a date in plain terms. For example, you could say
@samp{expr date =~ /2014/}.
@samp{expr "date =~ /2014/"}.

@item expr comment =~ /REGEX/
@item expr "comment =~ /REGEX/"
A regular expression that matches against a posting's comment
field. This searches only a posting's field, not the transaction's note
or comment field. For example, @code{ledger reg "expr" "comment =~
Expand All @@ -8303,7 +8303,7 @@ but will not match:
To match the latter, use @samp{ledger reg "expr" "note =~ /landline/"}
instead.

@item expr note =~ /REGEX/
@item expr "note =~ /REGEX/"
A regular expression that matches against a transaction's note field.
This searches all comments in the transaction, including comments on
individual postings. Thus, @samp{ledger reg "expr" "note =~ /landline/"}
Expand Down Expand Up @@ -8333,23 +8333,23 @@ A sub-expression is nested in parenthesis. This can be useful passing
more complicated arguments to functions, or for overriding the natural
precedence order of operators.

@item expr base =~ /REGEX/
@item expr "base =~ /REGEX/"
A regular expression that matches against an account's base name. If
a posting, this will match against the account affected by the
posting.

@item expr code =~ /REGEX/
@item expr "code =~ /REGEX/"
A regular expression that matches against the transaction code (the
text that occurs between parentheses before the payee).

@item expr any(KEYWORD =~ /REGEX/)
@item expr "any(KEYWORD =~ /REGEX/)"
The @command{any} keyword is used to specify that at least one posting of
the transaction must match the expression in brackets. For example,
@samp{ledger -f d reg expr "any(account =~ /Assets:/)"} can be used to
display all transactions which involve at least one @samp{Assets:}
account.

@item expr all(KEYWORD =~ /REGEX/)
@item expr "all(KEYWORD =~ /REGEX/)"
The @command{all} keyword is used to specify that all postings of a
transactions must match the expression in brackets. For example,
@samp{ledger -f d reg expr "all(account =~ /Assets:/)"} can be used to
Expand Down