Help in regex builder

REDLINES: P.126924 - TIR - Ready for permitting - ADOT.
Above is the string and this is not fixed only fixed thing is we get the number is string which start with P.

I want to get that number from string which start with P.

Hi @Puneet_Singh1

Try this:
P.\d+

result = System.Text.RegularExpressions.Regex.Match(str_InputVar, "P.\d+").Value

Hi @Puneet_Singh1

(?<=P.)(\d+)

or

(P.)(\d+)

@Puneet_Singh1

System.Text.RegularExpressions.Regex.Match(Input,"(?<=P.)(\d+)").Value

or

System.Text.RegularExpressions.Regex.Match(Input,"(P.)(\d+)").Value

@Puneet_Singh1

input_string = “REDLINES: P.126924 - TIR - Ready for permitting - ADOT.”

Regex:

r’P.(\d+)’

Use the below Regex in won’t fail in any condition.

(^p.|P.\d+)

Thanks Supriya for help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.