Hi,
Need to know regex to get Project ID. Below is text I want the project ID that A01X7Z1 in future it would be of 5 digit 6 digit or might be 7 or 8. Please help me out in getting project id
Hello,
Project: A01X7Z1 is Ready for Batching.
Thank You
Yoichi
(Yoichi)
August 20, 2020, 2:03pm
2
Hi,
Can you try the following expression?
System.Text.RegularExpressions.Regex.Match(text,"(?<=Project:\s*)\S+").Value
Regards,
1 Like
Yoichi
(Yoichi)
August 20, 2020, 2:15pm
4
Hi,
You need to set Final as String type because your project Id is not integer (Int32) as “A01X7Z1”.
Regards,
Dave
(David Wiebelhaus)
August 20, 2020, 2:15pm
5
That error is occurring because your variable called “Final” is of type integer, but the RegexMatch.Value returns a string.
Either change the “final” integer to be of type string, or wrap the right side of an assign with a CInt() which converts the string to integer.
Yoichi
(Yoichi)
August 20, 2020, 2:22pm
7
Hi,
Can you try the following? Probably you can extract project ID from mail body directly.
System.Text.RegularExpressions.Regex.Match(Body,"(?<=Project:\s*)\S+").Value
Regards,
1 Like
system
(system)
Closed
August 23, 2020, 2:24pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.