I've tried the following regex : var regex = new Regex("code=.*?'");
to get the value of code=value' till it hits the character '
In the webpage the string looks like this : code=42141241.48643196'
Could someone help me with the regex?
Use this:
var regex = new Regex("code=[^']*?'");
The [^']
represents the set of all characters with the exception of '
.
But please: Be aware that using regular expressions is not the correct way to parse HTML pages.