Regular expression to extract a string

I need to extract 1.50 in this string from the source code of the web page, or the entire line and then I'll parse it down to the 1.50.
<\/span>\n\n\n"},"MNN$":{"9303565":"$1.50"},"WARRANTY":{}}),

I am using Excel VBA.

Here is the function

Sub ExtractData()

Dim regEx
Dim i As Long
Dim pattern As String
Set regEx = CreateObject("VBScript.RegExp")
regEx.IgnoreCase = True
regEx.Global = True
regEx.pattern = "[what do I put in here?]"


End Sub
rrhandle8Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rrhandle8Author Commented:
I should have add this clue. The string below is unique in the document

"MNN$":{"9303565":"$1.50"}
0
aikimarkCommented:
include the quotes in the expression.  You will need to double the quotes inside a string.
"$(\d+\.\d\d)"

Open in new window

0
rrhandle8Author Commented:
First I need to extract the entire line from the html document.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

aikimarkCommented:
no, you don't
0
aikimarkCommented:
If you need just that one item, among many similar items, use this pattern
{"9303565":"$(\d+\.\d\d)"}

Open in new window

0
rrhandle8Author Commented:
OK. Thanks. I will try it.
0
rrhandle8Author Commented:
regEx.pattern = "{"9303565":"$(\d+\.\d\d)"}"

Expect end of statement error
0
aikimarkCommented:
As I stated earlier, in order for a string literal to contain quote characters, the internal quote characters need to be doubled.
regEx.pattern = "{""9303565"":""$(\d+\.\d\d)""}"

Open in new window

0
rrhandle8Author Commented:
That didn't work either.  
The 9303565 is a unique number, so I can understand why it does work on the items I an feeding.
The line would be like "MNN$":{"9303565":"$1.50"} where 9303565 changes, then the MNN$":{ is unique within the document.
0
aikimarkCommented:
That didn't work either.
Are you still getting an error message?
What string are you using for your pattern matching?  Are you sure it contains the 9303565 data?
0
aikimarkCommented:
I'm stepping away from the keyboard for a while.
0
rrhandle8Author Commented:
9303565 is a unique number that changes on each web page.  I am looking for the $1.50 that is to the right of it.
0
aikimarkCommented:
the 1.50 will be in submatches(0)

If the number changes, then I should be able to alter the pattern to work in the general case if you tell me more about those values.
0
rrhandle8Author Commented:
aikimark,  Thanks for the help.  I solved the problem using a different technique, but I would like to know how to do this with regular expressions.

There is only one line in the html that contains MNN$":{"9303565":"$1.50"}
The only thing that changes is the long number in the middle and the price.
There is always a long number in the middle, and a price at the end.
I have discovered that I need to extract long number in the middle and the price.
The regular expression should return (in this case) 9303565 and 1.50.
0
aikimarkCommented:
If it is the only price (currently formatted) value in these web pages, you can use the original pattern I posted. http:#a40319764


If you need to expand the match out to the curly brackets, you can use a modified version of what I posted in this comment: http:#a40320039
regEx.pattern = "{""\d+"":""$(\d+\.\d\d)""}"

Open in new window

In both cases, Submatches(0) contains the data you seek.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Regular Expressions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.