Javascript examples for RegExp:Match Number
Use regex to replace numbers with manipulated number
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> <script> var s = "4/7/12"; var n = s.split('/').map(function(el) { return 25 - Number(el);// w ww . ja va 2 s .com }).join('/'); console.log(n); </script> </body> </html>