can somebody help me write a regex to use with test function for find exactly received number on list of string or numbers that has comma separated numbers.
For ex. I have number 125 like argument and string like '12,74,48,125,1253,1' or if it more easy to use list of numbers 12,74,48,125,1253,1 (I can use both)
How can I write regex to find exactly this number and return true o false.
I used this one, but it don't find if number has 3 o 4 digits
if(new RegExp('\\b'+number+'\\b').test('12,74,48,125,1253,1')){
alert('true');
}
This list can also be just only one number like '125'
I have little practice with regex.
Thanks in advance.