I think I have all my ducks in order here, I am attempting to search my UL list using brackets either using a left one ( or a right one ) and I am getting a JavaScript kick back error:
"Expected '(' in regular expression".
I am by no means a regex expert here but what exactly could be the problem, i'd like to ideally be able to search using by any letters, numbers or special characters of my choosing in my input box without having the error as I described above.
Using Ie. 11, Fiddle is here: http://jsfiddle.net/acbabis/4cfQ8/show/
jQuery friendly:
$('#refdocs').on('keyup change', function () {
var search = $(this).val();
$('#refdocs_list li').each(function () {
var val = $(this).text();
$(this).toggle( !! val.match(search)).html(
val.replace(search, function(match) {return '<span style="background-color: #FFFF00">'+match+'</span>'}, 'gi')
);
});
});