Regexp non-capturing groups
https://stackoverflow.com/questions/tagged/regex(https?|ftp)://([^/\r\n]+)(/[^\r\n]*)?Match "http://stackoverflow.com/"
Group 1: "http"
Group 2: "stackoverflow.com"
Group 3: "/"
Match "https://stackoverflow.com/questions/tagged/regex"
Group 1: "https"
Group 2: "stackoverflow.com"
Group 3: "/questions/tagged/regex"(?:https?|ftp)://([^/\r\n]+)(/[^\r\n]*)?Match "http://stackoverflow.com/"
Group 1: "stackoverflow.com"
Group 2: "/"
Match "https://stackoverflow.com/questions/tagged/regex"
Group 1: "stackoverflow.com"
Group 2: "/questions/tagged/regex"Last updated