Skip to main content
Cadet | Tier 2
January 5, 2022
Solved

How resolve this issue?/

  • January 5, 2022
  • 1 reply
  • 145 views

Hi,

I am extracting 7 digit number from given strings

Screenshot (84)using regex (\b\d{7}\b) , during first and second iteration it will take the 7 digit number then move to the third iteration its shown error like this(An unexpected error occurred. 

begin -1, end 6, length 57), Maybe the third string do not have a 7 digit number.

Anyone know how to resolve this issue?

    This topic has been closed for replies.
    Best answer by Ashwin A.K

    Hi @Prasanth A​ ,

     

    Try using the Regex Tools: Extract a Regex Match Action

     

    image 

    The alternative would be to use the String: Replace Action like so to retrieve the match:

     

    (?<=\d{7}).*|.*(?=\d{7})

     

    image 

    You can then check if $rExcelRecord{Message}$ Not Equal sMatch -> Match present

     

    Kind Regards,

    Ashwin A.K

    1 reply

    Ashwin A.K
    Navigator | Tier 3
    January 5, 2022

    Hi @Prasanth A​ ,

     

    Try using the Regex Tools: Extract a Regex Match Action

     

    image 

    The alternative would be to use the String: Replace Action like so to retrieve the match:

     

    (?<=\d{7}).*|.*(?=\d{7})

     

    image 

    You can then check if $rExcelRecord{Message}$ Not Equal sMatch -> Match present

     

    Kind Regards,

    Ashwin A.K

    Blogs at TheCodingTheory - https://www.thecodingtheory.com