0

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?

Jack
  • 13
  • 1
  • 5

1 Answers1

1

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.

Community
  • 1
  • 1
Hauke P.
  • 2,695
  • 1
  • 20
  • 43