Extract number from string

extract number from string through regex

by Anand Jee

JavaScript

/*
Format
comment_like_123456
12312_abc_111
(518) 237-4368
comment_like_123456 (518) 237-4368
*/
var suffix = '(518) anand2377\-4368....2';
alert(suffix.replace(/[^0-9.]/g,''));