/**
* 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.4 1304164 80868 ? Ssl Oct24 311:28 node /home/sasa/.pm2/modules/pm2-logrotate/node_modules/pm2-logr sasa 1200 0.9 0.8 11725056 142320 ? Ssl Oct24 555:05 node /home/sasa/dex8/dex8-api/starter.js sasa 1208 0.3 0.4 1302696 71328 ? Ssl Oct24 224:31 node /home/sasa/dex8/dex8-panel/server/index.js sasa 1224 0.9 0.6 11846288 107272 ? Ssl Oct24 553:52 node /home/sasa/dex8/dex8-www/server/index.js sasa 1236 0.5 0.6 11814156 99236 ? Ssl Oct24 344:08 node /home/sasa/mikosoft_hr/www-mikosoft-hr/server/index.js sasa 1255 0.7 0.5 1330860 84728 ? Ssl Oct24 465:48 node /home/sasa/mikosoft-info/api-mikosoft-info/starter.js sasa 1257 0.3 0.4 1301128 69748 ? Ssl Oct24 227:47 node /home/sasa/mikosoft-info/www-mikosoft-info/server/index.js sasa 1289 0.3 0.4 1298204 66288 ? Ssl Oct24 224:26 node /home/sasa/dex8/dex8-kiosk/server/index.js sasa 1363 3.1 2.6 12134268 436252 ? Ssl Oct24 1946:28 node /home/sasa/voovuu/voovuu-pub/server/index.js sasa 1449 0.3 0.3 1232360 64668 ? Ssl Oct24 235:21 node /home/sasa/dex8/dex8-worker/starter.js sasa 1528 1.7 2.8 33132680 460288 ? Ssl Oct24 1086:17 node /home/sasa/dex8/dex8-worker/starter.js sasa 1529 0.3 0.3 1100900 64556 ? Ssl Oct24 234:56 node /home/sasa/dex8/dex8-worker/starter.js sasa 1606 0.3 0.3 1100900 64800 ? Ssl Oct24 235:00 node /home/sasa/dex8/dex8-worker/starter.js sasa 1607 0.3 0.4 1101156 65668 ? Ssl Oct24 234:25 node /home/sasa/dex8/dex8-worker/starter.js sasa 1705 0.3 0.4 1102184 66276 ? Ssl Oct24 234:31 node /home/sasa/dex8/dex8-worker/starter.js sasa 1706 0.3 0.3 1101156 64608 ? Ssl Oct24 234:07 node /home/sasa/dex8/dex8-worker/starter.js sasa 1805 0.3 0.4 1167968 66856 ? Ssl Oct24 234:31 node /home/sasa/dex8/dex8-worker/starter.js sasa 1807 0.3 0.3 1100128 63924 ? Ssl Oct24 229:48 node /home/sasa/dex8/dex8-worker/starter.js sasa 1885 0.3 0.4 1102696 66360 ? Ssl Oct24 231:10 node /home/sasa/dex8/dex8-worker/starter.js sasa 1886 1.7 0.9 11857744 160984 ? Ssl Oct24 1092:32 node /home/sasa/mikosoft-info/crypto-mikosoft-info/server/index. www-data 1277521 0.0 0.0 2608 528 ? S 02:00 0:00 sh -c ps -aux | grep node www-data 1277523 0.0 0.0 3304 644 ? S 02:00 0:00 grep node sasa 2628167 0.8 0.7 1172580 128920 ? Ssl Nov04 367:59 node /home/sasa/voovuu/voovuu-api/starter.js sasa 3168557 0.6 0.5 11801300 89936 ? Ssl Nov06 265:40 node /home/sasa/mikosoft-info/dodo-mikosoft-info/server/index.js sasa 3169051 0.4 0.5 11798664 82568 ? Ssl Nov06 175:15 node /home/sasa/@mikosoft/dodo-examples/server/index.js