Javascript examples for RegExp:Match URL
Use Regex for url followed by certain text
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w .jav a 2 s. c o m*/ var text = 'https://drive.google.com/open?id=123123123'; var result = text.replace('https', 'http').replace('open?', 'uc?export=view&'); console.log(result); } </script> </head> <body> </body> </html>