Skip to content

Commit e5405c1

Browse files
authored
Merge pull request #40 from memborsky/add-regular-expression-contains-support
Support regular expression contains instead of 'a in b'
2 parents d4b8b87 + 7ff235a commit e5405c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jsonpath_ng/ext/filter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# under the License.
1313

1414
import operator
15+
import re
1516
from six import moves
1617

1718
from .. import JSONPath, DatumInContext, Index
@@ -25,7 +26,7 @@
2526
'<': operator.lt,
2627
'>=': operator.ge,
2728
'>': operator.gt,
28-
'=~': operator.contains,
29+
'=~': lambda a, b: True if re.search(b, a) else False,
2930
}
3031

3132

0 commit comments

Comments
 (0)