I have the following string:
ABCD/SESSION REMARKS/SESSION REMARKS_002FT2213700215_ /CODTYPTR/049 //R101841246/058 Session 220517080 REF: 02024741031486605002FT221
And i want to extract the nine digits that from "R101841246".
I have tried using Extract Regex in Utility - Strings of Blueprism, using the regex pattern (?<Lower>\d{9})
but the code is extracting 221370021, the first nine digits from SESSION REMARKS_002FT2213700215_
.
I need a regex that will strictly extract nine consecutive digits and ignore occurrences where there is over nine digits
You can use
\bR-?(?<Lower>\d{9})\b
Here, it matches
\b
- a word boundaryR
- an R
letter-?
- an optional hyphen(?<Lower>\d{9})
- nine digits captured into Group "Lower"\b
- a word boundary.See the regex demo.