Test, validate and match regular expressions
This regex captures the portion of a URL before any query string or fragment, effectively extracting the base URL. It matches from the start of each line up to the first occurrence of '?' or '#', then consumes the rest of the line. Use it to isolate the path or domain when you need to strip query parameters and anchors from URLs.