Mr.H
January 21, 2021, 6:43am
1
Hi everyone
I have some string as below… i need to extract four number after “…XXX”
hfhughXXXXX1234
gbnfkXXXXXXXXX2341
jvnvXXXXXXX1111
The result : 1234, 2341, 1111
How to define number of “X” more than 3 character then will extract four number after it.
Thanks you!
Yoichi
(Yoichi)
January 21, 2021, 6:54am
2
Hi,
We can get them using Matches activity with the following pattern
"(?<=xxx)\d{4}"
If your target number exists at the end of the line, the following also works.
Pattern : "\d{4}$"
RegexOptions : Multiline
Regards,
1 Like
Mr.H
January 21, 2021, 6:55am
3
I have used this command but it still do some step : left(System.Text.RegularExpressions.Regex.Match(MyString.ToString,”(XXX).*(\d)”).ToString.Replace(“X”,“”).Trim,4)
How to do regex it only with one step
system
(system)
Closed
January 24, 2021, 6:57am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.