Regex non-capturing group is capturing
问题 I have this regex (?:\<a[^*]href="(http://[^"]+?|[^"]+?\.pdf)"+?[^>]*?)> The point of this regex is to capture every closing tag ('>') of an anchor that has an href that starts with "http://" or ends with ".pdf". The regex works, however it is capturing the first part of the anchor, which I absolutely need to NOT capture. In the following samples all are matching except second (which is fine) but only the last bracket should be captured and it is not the case. <a href="http://blabla">omg</a>