いつも大変お世話になっております。
下記の文字列の中かkら「16時00分」のみ抽出したいのですが、うまくいきません。
「令和5年10月31日(火)16時00分(必着とする。)」
Invoke Methodを設置したうえで、

代入で、
時刻=System.Text.RegularExpressions.Regex.Match(日にち,“(午前|午後)\d+時(\d+分)?”).Value
としましたが、
「時刻」の中は空になっています。
おわかりになることがあればご教授ください。
いつも大変お世話になっております。
下記の文字列の中かkら「16時00分」のみ抽出したいのですが、うまくいきません。
「令和5年10月31日(火)16時00分(必着とする。)」
Invoke Methodを設置したうえで、

代入で、
時刻=System.Text.RegularExpressions.Regex.Match(日にち,“(午前|午後)\d+時(\d+分)?”).Value
としましたが、
「時刻」の中は空になっています。
おわかりになることがあればご教授ください。
こんにちは
午前または午後が無いので
System.Text.RegularExpressions.Regex.Match(日にち,"\d+時(\d+分)?").Value
か
System.Text.RegularExpressions.Regex.Match(日にち,"(午前|午後)?\d+時(\d+分)?").Value
のいずれかお試しください
Hi @kiki1
You can use the below regular expression,
- Assign -> Input = "Tuesday, October 31, Reiwa 5, 16:00 (must arrive)"
- Assign -> output = System.Text.RegularExpressions.Regex.Match(Input,"(\d+:\d+)")

Hope it helps!!
Hope it helps!!
参考になりました。
ありがとうございます ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.