字符串:s=“
04月09日07时50分至04月09日05时50分为上班时间,上班需要满足8h。”
是否符合日期格式内容怎么判断,提取 除去s = s1..split("至")(0)方法外,怎么提取,谢谢老师!,另外想提取8h中的8怎么提取。
如果格式是固定的,参考
Dim pattern As String = "[0-9]{2}月[0-9]{2}日[0-9]{2}时[0-9]{2}分"
Dim txt = "04月09日07时50分至04月09日05时50分为上班时间,上班需要满足8h。"
Dim rgx = New System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
For Each match As System.Text.RegularExpressions.Match In rgx.Matches(txt)
Output.Show(match.Value)
Next
pattern = "[0-9]h"
rgx = New System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
For Each match As System.Text.RegularExpressions.Match In rgx.Matches(txt)
Output.Show(match.Value)
Next