adriank / ObjectPath

The agile query language for semi-structured data
http://objectpath.org
MIT License
380 stars 93 forks source link

no list of supported operators #98

Closed nebi-frame closed 2 years ago

nebi-frame commented 4 years ago

Hi all, I'm not able to find any documentation about all the supported operators for ObjectPath. For example I've used matches operator lots of the time but there's no signle mention for this operator in documentation. Or I'm not able to find it.

adriank commented 4 years ago

PRs highly welcomed. :) The intended use of matches is covered in tests:


def test_comparison_regex(self):
    self.assertIsInstance(execute("/aaa/"), type(re.compile("")))
    self.assertEqual(execute("/.*aaa/ matches 'xxxaaaadddd'"), True)
    self.assertEqual(execute("'.*aaa' matches 'xxxaaaadddd'"), True)
    self.assertEqual(execute("'.*aaa' matches ['xxxaaaadddd', 'xxx']"), True)```