I am new to regular expression, I have stored JSON data in table. I want to fetch data based on userId, userId is a property of Users Object.
Example: I want fetch all the records if users contain 513
My table data sample:
Table name:share
Id name sharedusers
1 xxxx {"accessType":0,"permission":"1","specificUsers":
[{"users":"502,512,513","permission":"1"}]}
2 yyy {"accessType":0,"permission":"1","specificUsers":
[{"users":"47,52,60","permission":"1"}]}
3 zzzz {"accessType":0,"permission":"1","specificUsers":
[{"users":"502,512,513","permission":"1"}]}
I have tried this code but I am getting all the records, filter is not applied
SELECT * FROM share where sharedusers REGEXP '"users":"[[:<:]]513[[:>:]]"';
Please give any sample.