Regex.Match help

Hello guys. Im trying to write a Regex formula, that would extract text from a View page source page of a website. The webpage and the data that I need looks like this:


The regex that I have now looks like below:

Regex.Match(strScriptText,"(?<=impressions':)[\s\S]+?\]").Value

The thing is, that my regex doesn’t work. I’m hoping to get some advice for it to work. Thanks :slight_smile:

@Povilas_Jonikas

Please try this

Regex.Match(strScriptText,"(?<=impressions').*",RegexOptions.MultiLine).Value

cheers

1 Like

Will try in a bit and let you know. Thanks for the help in advance! :grin:

1 Like

HI,

It seems lack of whitespace before colon. Can you try the following expression?

Regex.Match(strScriptText,"(?<=impressions'\s*:)[\s\S]+?\]").Value

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.