I'm trying to create regex to parse markdown links.
regex:
!\[[^\]]*\]\((.*)\s"(.*[^"])"?\s*\)
Test (link to live demo):
foo

bar
Group 1 will be image 2.png, and group 2 will be hello world.
The problem appears when I try to parse a link without title:
foo

bar
How I should modify regex to make it work in both cases?