regexblueprism

I want to use regex to extract nine digits from a string in Blueprism


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


Solution

  • You can use

    \bR-?(?<Lower>\d{9})\b
    

    Here, it matches

    See the regex demo.