Remove '$' from the current regular expression. It strictly matches the end of the line, which leads to the fact that your expression returns false in your desired lines. The following code returns TRUE for the referenced rows that were previously returned FALSE.
omgerd I automatically wrote the first answer in PHP, here is a quick JS editing
var pattern = /^\s*\d{8}\s*\+*(,\s*\d{8},*)?/; var data2 = '12345678 , 12345678 ,12345678'; if (pattern.test(data2) != 0) { alert("ok"); }
Conclusion: OK
source share