Skip to content

Commit

Permalink
Added EZRegex pattern for the split extension regex
Browse files Browse the repository at this point in the history
  • Loading branch information
smartycope authored and michaelmior committed Aug 16, 2024
1 parent 6bac2be commit d5a766f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jsonpath_ng/ext/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@


SUB = re.compile(r"sub\(/(.*)/,\s+(.*)\)")
SPLIT = re.compile(r"split(?:\s+)?\((?:\s+)?(?P<j>(?:(?:'|\"))?)(.+)(?P=j)(?:\s+)?,(?:\s+)?((?:(?:\-)?\d+|\*))(?:\s+)?,(?:\s+)?((?:\-)?\d+)(?:\s+)?\)")
# Regex generated using the EZRegex package (ezregex.org)
# EZRegex code:
# param1 = group(optional(either("'", '"')), name='quote') + group(chunk) + earlier_group('quote')
# param2 = group(either(optional('-') + number, '*'))
# param3 = group(optional('-') + number)
# pattern = 'split' + ow + '(' + ow + param1 + ow + ',' + ow + param2 + ow + ',' + ow + param3 + ow + ')'
SPLIT = re.compile(r"split(?:\s+)?\((?:\s+)?(?P<quote>(?:(?:'|\"))?)(.+)(?P=quote)(?:\s+)?,(?:\s+)?((?:(?:\-)?\d+|\*))(?:\s+)?,(?:\s+)?((?:\-)?\d+)(?:\s+)?\)")
STR = re.compile(r"str\(\)")


Expand Down

0 comments on commit d5a766f

Please sign in to comment.