I want to create an expression for querystrings, this stuff is hard!
I want to extract some keywords out of a query string for a search application in asp.net.
I decoded the url string first, so it's plain text
I have this to start with, but I want to add a keyword group
([\?\&])q=[^\&]+[\&]?
I get this ?q=harbour landing dental&
I'd like to trim off the stuff for pure words, but not sure if that's possible
I a开发者_如何学Clso have a long list of possible query string value fields that I want to check against
?q=
@q=
?qs=
&qs=
Why don't you just use the HttpRequest.QueryString collection?
If you have access to the HttpRequest
you should just use the HttpRequest.QueryString
property.
If you don't have access to that and only have the actual query string as a string you should just use the HttpUtil.ParseQueryString
function to get the NameValueCollection
.
精彩评论