读书人

正则如何得到value的值

发布时间: 2012-03-31 13:13:26 作者: rapoo

正则怎么得到value的值
<input type=""hidden"" id=""tbToken"" name=""_fmw.pu._0.tb"" value="123456"/>

[解决办法]

VB.NET code
Dim re As New Regex("value="(.*)"",RegexOptions.None)Dim matchMade As MatchCollectionmatchMade = re.Matches("yourStr")For Each matchMade0 As Match In matchMade    For index As Integer = 1 To matchMade0.Groups.Count - 1        MsgBox(matchMade0.Groups(index).Value)    NextNext
[解决办法]
VB.NET code
dim value as string = Regex.Match(yourStr,"(?<=<input[^>]*?\bvalue="")[^""]+").Value 

读书人网 >VB Dotnet

热点推荐