-1

I have tried hrs for this regex and couldn't sort it out, and seek for some help.

/\[.*\]\((https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g

Here is the link to my regex page link

https://regex101.com/r/Xc5zDp/1

I try to pick out all the links in the sentence and example like this [link](http://test.com), but it keep select both links all together

Bill
  • 17,872
  • 19
  • 83
  • 131

1 Answers1

1

Simplify your regex to this: \[.*?\)

Is this what you want? Demo

Zirbo Filip
  • 300
  • 1
  • 13
  • Note that this is basic solution. You cannot use "[ ]" outside of link description but you can use "( )" wherever you want – Zirbo Filip Sep 28 '16 at 08:31