I just used the below instruction in javascript to search for a specific row in one column and filter the records in the data table.
term = $(this).val(); table.column(2).search(term, true, false).draw();
Here is my JSON line:
[{"userid":"2315","location":"x","details":"{\"subjectββs\": {\"English\": [\"meena\", \"teena\"]}, \"hours\": {\"2\"}}}", {"userid":"3009","location":"y","details":"{\"subjects\": {\"English\": [\"meena\"]}, \"hours\": {\"4\"}}}, {"userid":"3109","location":"z","details":"{\"English\": [\"suresh\", \"divya\"]}, \"hours\": {\"4\"}}, {"userid":"3209","location":"a","details":"{\"English\": [\"ramesh\", \"meena\"]}, \"hours\": {\"4\"}}, {"userid":"3309","location":"b","details":"{\"subjects\": {\"English\": [\"revathi\", \"meena\"]}, \"hours\": {\"4\"}}} ]
Want to match any "English" value with a regular expression and search with these values ββto filter records. Something like below.
regex = '"English": ["'+ '.*' +term+'.*'; table.column(3).search(regex, false, false).draw();
But the above statement does not work.
Can someone suggest me the correct way to write regex for this?