Q:

Regular expression to get Url without Query string

I am looking for a way to parse URL without queryString using Regular expression.
i have url like "http://abc.com/csd?/aaa/bbb"
expected is like "http://abc.com/csd"
Anybody help me on this.

A:

If you just want everything before the query string:
^[^?]+

