diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-02-04 18:36:07 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-02-04 18:45:21 +0100 |
commit | c7e938d6582a436dddc938539e72dd1320625c54 (patch) | |
tree | ae5ed1e3ee150ea8936433fed04f6a2dd03ac2d0 /main.c | |
parent | cd6629fc75787cbfcbec12282bd738373bc46ac6 (diff) | |
download | jsonpath-c7e938d6582a436dddc938539e72dd1320625c54.tar.gz |
implement POSIX regexp support
Introduce a new operator `~` and new `/.../eis` regular expression syntax.
This allows filtering by regular expression, e.g.
jsonfilter -s '[ "foo", "bar", "baz" ]' -e '$[@ ~ /^b/]'
... would yield the values `bar` and `baz`.
Possible regular expression modifiers are:
- `e` ... enable extended POSIX regular expressions
- `i` ... perform case insensitive matches
- `s` ... let ranges and `.` match the newline character
A regular expression literal may occur on the left or the right side of
the `~` operator, but not on both.
In case neither side of the `~` operator is a regular expression, the right
side will be treated as regular expression pattern. Non-string values are
converted to their string representation before performing matching.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
0 files changed, 0 insertions, 0 deletions