I have html content where some words have success, failure etc. I am trying to use a regular expression to filter with single keyword or combination of keywords from multi selection checkboxes. The result of multi selection checkboxes is a comma separated string. Is there any condition to check if my html content has success or failure or other string cases. I am trying to search for or clause with regular expression
Case 1
var filter = 'success';
$(this).html().search(new RegExp(filter, "i")) > 0) {
alert('data found')
}
Case 2:
var filter = 'success, failure';
$(this).html().search(new RegExp(filter, "i")) > 0) {
alert('data found')
}