Regular Expression help

Deepfreezed

New member
Joined
Feb 6, 2004
Messages
1
I need to pick out a set of coordinates on a line using regex....

the line could be like this

aasdf dfs ( chh , fgh) hfgh((((())))) ( 4, 6) srtgdg (4 , 5 )asasd

valid point would be (4,6) and (4,5)

how do I do this?

Thx
 
Dim r As New Regex("(4,5)")
Dim m As Match = r.Match(your string)
If m.Success Then
Console.WriteLine("Found match at position " & m.Index.ToString())
End If
 
Whats so funny?
How does that (4,5) work because it doesnt for me and I used this instead :).


(numbers or space,numbers or space)
Code:
\([0-9\s]+,[0-9\s]+\)
Explanation of the above:
\( is the parenthesis open
\) is the parenthesis close
\s is a space
[0-9\s] is a number or a space
+ means that it is valid if a number or a space is between.
 
Back
Top