I'm using the following code to extract a number, upto 3 digits long, from a
web page:
Dim str2Find As String = ">(\d{0,3}|&nbs p;)<"
Dim regNumReplies As New RegularExpressi ons.Regex( _
str2Find, Options:=Regula rExpressions.Re gexOptions.Sing leline)
Return regNumReplies.M atches(str, str2Find).Item( 0).Groups(1).To String
If the number does not exist, it returns " ". Is there a way, using
RegEx, to return either the digits found, or if " " is found, return
"0"?
--
|
+-- Thief_
|
web page:
Dim str2Find As String = ">(\d{0,3}|&nbs p;)<"
Dim regNumReplies As New RegularExpressi ons.Regex( _
str2Find, Options:=Regula rExpressions.Re gexOptions.Sing leline)
Return regNumReplies.M atches(str, str2Find).Item( 0).Groups(1).To String
If the number does not exist, it returns " ". Is there a way, using
RegEx, to return either the digits found, or if " " is found, return
"0"?
--
|
+-- Thief_
|
Comment