vb.net - match numbers

hello there,
I would like to know how can I match numbers for example in the (2 downloaded images)
I would like to match only numbers that are over 35.. how can I do that?

<SPAN class=fcg>2 downloaded images</SPAN></DIV>
LVL 1
XK8ERAsked:
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.

nepaluzCommented:
do you mean get numbers from the string "2 downloaded images" ?
XK8ERAuthor Commented:
correct
nepaluzCommented:
You will haveto work out how to extract the string to:

Dim MyElement As XElement = "<SPAN class=fcg>2 downloaded images</SPAN>"

'then get the value of the XElement and split by space

Dim MyString = MyElement.value.ToString.Split(" ")

For x = 0 to MyString.Count - 1
        If IsNumeric(MyString(x)) Then
           If MyString(x) > 35 Then MessageBox.Show("Over 35 index " & x)
        End If
 Next

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
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Mohamed AbowardaSenior Software EngineerCommented:
Here is a function to extract the first number from string:
Public Function getNum(ByVal str As String)
    Dim s() As String = str.Split(Space(1))
    For Each word As String In s
        If IsNumeric(word) Then
            Return word
        End If
    Next
    Return False
End Function

Open in new window

XK8ERAuthor Commented:
I am looking for the regex pattern something like this.. but its not working

Dim pattern As String = "<(?<tag>\w*)>[\n\s]*(?<text>.*" & txt2highlight & ".*)[\n\s]*</\k<tag>>"
nepaluzCommented:
You never asked for a regex pattern in the first place. In-fact, you responded to my query in the positive when asked to clarify on whether it was from a string.

To my mind, both solutions suggested here so far answer your initial question. If you'd like to open another question about Regex, you indeed are free to do so, however, you will have to mark this question as answered.
Mohamed AbowardaSenior Software EngineerCommented:
Have you checked my solution?
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
Visual Basic.NET

From novice to tech pro — start learning today.