What I'm trying to do is pretty simple, although I run into difficulties. I have a string that is a URL, it will be in the format http://www.somedomain.com?id=someid , which I want to extract, this is some part. I suppose I can use regex, but I'm not very good with them, here is what I tried:
Match match = Regex.Match(theString, @"*.?id=(/d.)");
I get a regular expression exception saying that there was a bug parsing the regular expression. The way I read this is "any number of characters" , then the literal "?id=" followed by "by any number of digits" . I put the numbers in the group so that I could pull them out. I'm not sure what's wrong with that. If anyone could tell me what I am doing wrong, I would appreciate it, thanks!
source share