0

From this string:

<strong class="big zindex-pt zindex-pt-all">&pound;2,362,214</strong>

I am trying to get &pound;2,362,214 using this Regex in Excel VBA:

 .Pattern = "<strong class="big zindex-pt zindex-pt-all">([\s\S]*?)<"

Any ideas what I am doing wrong?

2
  • 1
    Well, for one thing you're parsing HTML with regular expressions. Commented Jun 16, 2015 at 23:19
  • See this answer. Commented Jun 17, 2015 at 3:08

2 Answers 2

1

Escape double quotes inside regex: " to ""

Sign up to request clarification or add additional context in comments.

3 Comments

there are a lot of other html lines that I didn't mention in the question.. I need to target this line specifically.
I am actually getting compile errors in Excel VBA. Somehow I need to exit the quotemarks in my Pattern ?
In VBA " is escaped with "" (doubled-up quotes)
0

ok thanks. Actually this works for me:

.Pattern = "<strong class=""big zindex-pt zindex-pt-all"">([\s\S]*?)<"

1 Comment

\S matches anything that is not \s and both of them combined matches anything at all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.