Many URL rewriting utilities allow Regex matching. I need some URLs to be matched against a couple of main querystring parmeter values no matter what order they appear in. For example let's consider an URL having two key parameters ID= and Lang= in no specific order, and maybe some other non-key params are interspersed.
An Example URL to be matched with key params in any order:
- http://www.example.com/SurveyController.aspx?ID=500&Lang=4 or
- http://www.example.com/SurveyController.aspx?Lang=4&ID=500
Maybe with some interspersed non-key params:
- http://www.example.com/SurveyController.aspx?Lang=3&ID=1&misc=3&misc=4 or
- http://www.example.com/SurveyController.aspx?ID=1&misc=4&Lang=3 or
- http://www.example.com/SurveyController.aspx?misc=4&Lang=3&ID=1 or
- etc
Is there a good regex pattern to match against querystring param value in any order, or is it best to duplicate some rules, or in general should I look to other means?
Note: The main querystring values will also be captured using brackets i.e. ID=(3)&Lang=(500) and substituted into the destination URL, but that's not the focus of the question.