Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^\$(\.{1,2}([a-z]+(\[(\d+|\*|\(@\.length-[1-9]\)|-?\d+:|:-?\d+|\d+,\d+|\?\((@\.[a-z]+((<=?|>=?|==)(\d+(\.\d+)?|\".*\"))?)( ?&& ?(@\.[a-z]+((<=?|>=?|==)(\d+(\.\d+)?|\".*\"))?))?\))\])?|\d+|\*))*$
/
gmi

Description

Regex for JSON Path

Source

Specs and cases were taken from here: Link to npm library jsonpath

Accessibility

  1. For arrays can be used $..books[2] or $..books.2
Submitted by thornedll - a month ago