/**
* String methods: replace
* The replace() method returns a new string with some or all matches of a
* pattern replaced by a replacement.
*/
var str, x, xg, xi;
str = "simple example of simple string BIG big";
x = str.replace('simple', 'not simple'); //replace first match
xg = str.replace(/s\w+e/g, 'not simple'); //replace all matches
xi = str.replace(/BiG/i, 'SmaLL'); //case insensitive replacement
console.log(x); // not simple example of simple string BIG big
console.log(xg); // not simple example of not simple string BIG big
console.log(xi); // simple example of simple string SmaLL big
not simple example of simple string BIG big not simple example of not simple string BIG big simple example of simple string SmaLL big
$ps -aux | grep node (list all node processes) sasa 1194 0.5 0.5 1304004 82328 ? Ssl Oct24 481:09 node /home/sasa/.pm2/modules/pm2-logrotate/node_modules/pm2-logr sasa 1200 1.0 0.8 11723376 140052 ? Ssl Oct24 861:06 node /home/sasa/dex8/dex8-api/starter.js sasa 1208 0.4 0.4 1305000 73516 ? Ssl Oct24 347:02 node /home/sasa/dex8/dex8-panel/server/index.js sasa 1224 0.9 0.7 11826848 116772 ? Ssl Oct24 820:11 node /home/sasa/dex8/dex8-www/server/index.js sasa 1236 0.6 0.6 11811340 98428 ? Ssl Oct24 546:35 node /home/sasa/mikosoft_hr/www-mikosoft-hr/server/index.js sasa 1255 0.9 0.5 1330860 84628 ? Ssl Oct24 740:52 node /home/sasa/mikosoft-info/api-mikosoft-info/starter.js sasa 1257 0.4 0.4 1304920 72180 ? Ssl Oct24 353:04 node /home/sasa/mikosoft-info/www-mikosoft-info/server/index.js sasa 1289 0.4 0.4 1298260 67780 ? Ssl Oct24 346:48 node /home/sasa/dex8/dex8-kiosk/server/index.js sasa 1363 3.9 2.8 12177788 474632 ? Ssl Oct24 3274:45 node /home/sasa/voovuu/voovuu-pub/server/index.js sasa 1449 0.4 0.4 1232360 65580 ? Ssl Oct24 364:47 node /home/sasa/dex8/dex8-worker/starter.js sasa 1529 0.4 0.3 1100900 65204 ? Ssl Oct24 364:10 node /home/sasa/dex8/dex8-worker/starter.js sasa 1606 0.4 0.3 1101156 65080 ? Ssl Oct24 365:13 node /home/sasa/dex8/dex8-worker/starter.js sasa 1607 0.4 0.3 1100900 64680 ? Ssl Oct24 364:00 node /home/sasa/dex8/dex8-worker/starter.js sasa 1705 0.4 0.4 1101928 66152 ? Ssl Oct24 363:35 node /home/sasa/dex8/dex8-worker/starter.js sasa 1706 0.4 0.4 1101412 65564 ? Ssl Oct24 362:56 node /home/sasa/dex8/dex8-worker/starter.js sasa 1805 0.4 0.4 1168224 66320 ? Ssl Oct24 364:06 node /home/sasa/dex8/dex8-worker/starter.js sasa 1807 0.4 0.3 1100128 64928 ? Ssl Oct24 355:33 node /home/sasa/dex8/dex8-worker/starter.js sasa 1885 0.4 0.3 1100136 63484 ? Ssl Oct24 357:21 node /home/sasa/dex8/dex8-worker/starter.js sasa 1886 2.4 1.0 11873380 175364 ? Ssl Oct24 2043:33 node /home/sasa/mikosoft-info/crypto-mikosoft-info/server/index. sasa 307618 0.3 0.3 1098848 63312 ? Ssl 03:03 2:14 node /home/sasa/dex8/dex8-worker/starter.js www-data 349894 0.0 0.0 2608 584 ? S 13:51 0:00 sh -c ps -aux | grep node www-data 349896 0.0 0.0 3304 720 ? S 13:51 0:00 grep node sasa 2628167 1.0 0.8 1177448 132072 ? Ssl Nov04 673:35 node /home/sasa/voovuu/voovuu-api/starter.js sasa 3168557 0.7 0.5 11810768 94020 ? Ssl Nov06 487:50 node /home/sasa/mikosoft-info/dodo-mikosoft-info/server/index.js sasa 3169051 0.5 0.5 11798920 82976 ? Ssl Nov06 333:54 node /home/sasa/@mikosoft/dodo-examples/server/index.js