regex c# optional group - should act greedy?
问题 having regex ~like this: blablabla.+?(?:<a href="(http://.+?)" target="_blank">)? I want to capture an url if I find one... finds stuff but I don't get the link (capture is always empty). Now if I remove the question mark at the end like this blablabla.+?(?:<a href="(http://.+?)" target="_blank">) This will only match stuff that has the link at the end... it's 2.40 am... and I've got no ideas... --Edit-- sample input: blablabla asd 1234t535 <a href="http://google.com" target="_blank">