I am using the URL for an HTTP resource as unique identifiers for the resources (surprise).
These are all different:
http://localhost/Docs/SomeDocument?group=33&checksafety=true
http://localhost/Docs/SomeDocument?group=11&checksafety=true
http://localhost/Docs/SomeDocument?group=11&checksafety=false
However, I have a third query parameter that should not differentiate resources (on the server side, it pulls the same data from the database).
These are the same (the group and checksafety parameters are the same):
http://localhost/Docs/SomeDocument?group=11&checksafety=false&rendergroup=A
http://localhost/Docs/SomeDocument?group=11&checksafety=false&rendergroup=B
http://localhost/Docs/SomeDocument?rendergroup=C&group=11&checksafety=false
Is a regex appropriate here?
Is there a better way?
I am using C#, .NET 3.5 and ASP.NET.
You could split to get the querystring, then split to get each group, see if all of them have the same number of groups (by group I mean “variable=value”). Analyse each group individually and eliminate the ones that doesn’t care.
Then, it is easier to analyse. Here are some ideas
–EDIT included Nick Berardi suggestion