How to filter the list by the presence of numbers in the beginning of the line?

Make the filter list on the first characters. With all the letters OK, but there is a problem with numbers.
How to make pressing the button "1" (see screenshot) displayed only rows that begin with the digit (0 to 9).


April 19th 20 at 12:34
1 answer
April 19th 20 at 12:36
$(document).on('click', '.testa', function() {
 const reg = RegExp(`^[${$(this).text()}]`, 'i');
 $('.red a').hide().filter((i, n) => reg.test($(n).text())).show();
Thank you very much! - Era_Hane27 commented on April 19th 20 at 12:39

Find more questions by tags jQuery