Home
Run >
<DOCTYPE html> <html> <head> <script type="text/javascript"> var str = "This is test of javascript string replace function."; var reExp = /(\S+)(\s+)(\S+)/g; // This will exchange each pair of words. document.write(str.replace(reExp,"$3$2$1") + "</br>"); </script> </head> <body> </body> </html>