bp777
1
Hello,
Which Regex could be used for extracting the whole string which starts with “72”?
There are a few scenarios:
- There can be only number written (7230011274)
- Various strings can be before this number (811 / 7230011274)
However, the number is always last in the row.
I really appreciate any help you can provide.
ppr
(Peter Preuss)
2
along with possible variations like closing ) or end of string
bp777
3
Which expression should I use?
I am trying with System.Text.RegularExpressions.Regex.Match(string, “/72\d+”) but it returns empty string?
ppr
(Peter Preuss)
4
bp777
5
Thank you @ppr, I really appreciate your help!
Cheers! 
bp777
6
@ppr , I forgot to mention that string can also contain “72” in the middle of some number:
8235720310 / 7235717482.
How can I write an expression to take string only if starts with 72?
ppr
(Peter Preuss)
7
you can try pattern with work boundaries:

ppr
(Peter Preuss)
8
so here we do fail

But as mentioned can extend to the end bound e.g.

1 Like
bp777
9
Great, thank you @ppr once again!
system
(system)
Closed
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.