Javascript examples for RegExp:Match Number
Array natural sort method, sort string and filter number with regex
<html> <head></head> <body> <script> var arr = ['columnNumber6','columnNumber1','coulmnNumber11','columnNumber7','columnNumber12']; arr = arr.sort(function(a, b) { return +/\d+/.exec(a)[0] > +/\d+/.exec(b)[0]; });/*from ww w. j a v a 2 s . c o m*/ console.log(arr); </script> </body> </html>