I have the JavaScript search engine below. The problem is that when I type the word " tomato " it looks for the word " tomatoes ". It's probably a sensitivity problem or you're just picking up part of the typed word. Would it be possible to fix this using just javascript or jQuery?
$("#box").on('keyup', function() {
var matcher = new RegExp($(this).val(), 'gi');
$('.connect-cat').show().not(function() {
return matcher.test($(this).find('.name, .category').text())
}).hide();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input placeholder='Search' id='box' type='text' />
<div style='clear:both;'></div>
<div class='connect-cat'>
<span class='name'>tomatoes</span>
</div>
<div class='connect-cat'>
<span class='name'>tomato</span>
</div>
<div class='connect-cat'>
<span class='name'>apple</span>
</div>