PysonDB
- Install
- Example Code
- Command Line Operations
- Adding Data
- Get data
- Search data
- Update Data
- Delete Data
Search using Regex
- Methods
- reSearch(key, regex, objectify=False)
- Searches for the objects where the value of the key follows the given regex.
JSON file:file.json
{"data": [{"name": "pysondb", "type": "DB"},
{"name": "pysondb-cli", "type": "CLI"},
{"name": "fire", "type": "CLI"},
{"name": "stuff.py", "type": "GUI"},
{"name": "def23@c-py", "type": "TUI"},
{"name": "stuff(py", "type": "GUI"},
]}
reSearch(key, regex, objectify=False)
>> from pysondb import db
>> a=db.getDb("file.json")
>> print(a.reSearch("name", r"\w{3}\d{2}@c-py"))
>> [{'name': 'def23@c-py', 'type': 'TUI', 'id': 200151702869331613}]
>> print(a.reSearch("name", "stuff\(py"))
[{'name': 'stuff(py', 'type': 'GUI', 'id': 115618300909661724}]