Test, validate and match regular expressions
Splits a URL into three capture groups: the scheme and host (e.g., https://example.com), the port number including its colon (:8080), and the remaining path after an optional slash. Typically used with String.replace() (e.g., '$1/$2') to strip port numbers from URLs. The global and multiline flags allow processing multiple URLs across many lines in one pass.