Skip to content
Advertisement

Extract URLs from paragraph or block of text using a regular expression

I have a text and a script

JavaScript

The expected outcome must be

JavaScript

but the below getMatch is giving me incorrectly (skipping &x=y1)

JavaScript

How do I modify the function to return a complete URL

NOTE: This happens only when the email arguments are passed after it finds @ character, the function behaves weird.

Advertisement

Answer

Why not simplify:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement