I am using the following regex to match URLs within text
new RegExp(`(https?://\\S+\\.\\S+)\\s`, 'ig');
The problem is when URL appear within brackets like this
(e.g. https://hello.com/fridaysforfuture-eu-socialmedia)
It picks off the closing bracket as part of the URL
My expected behavior is to include Closing bracket in the match if URL is like
https://hello.com/name-(1)
but exclude closing bracket if URL is within brackets like this
(e.g. https://hello.com/fridaysforfuture-eu-socialmedia)