Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Regular Expression to search 6 or 7 digit numbers from String

  • 1.  Regular Expression to search 6 or 7 digit numbers from String

    Posted Tue September 15, 2020 01:07 PM

    Dears,

    I need someone urgent help to find 6 or 7 digit numbers from String. I have already tried using RegExFind (\d{6}|\d{7}) and isValueRegEx but it did not help.

    Suppose if string contains "0569204864 This is my mobile number - 799990 this is my ID". so here I want to extract 799990 but system is returning two matches which are 0569204 and 799990 and that is wrong.



    #IBMDatacap
    #Support
    #SupportMigration


  • 2.  RE: Regular Expression to search 6 or 7 digit numbers from String

    Posted Thu September 24, 2020 06:52 PM

    you can use "\b" at the start and end of the reg ex to match "word boundries:

    \b\d{6,7}\b

    will match:

    123456

    1234567

    will not match

    123456789



    #IBMDatacap
    #Support
    #SupportMigration


  • 3.  RE: Regular Expression to search 6 or 7 digit numbers from String

    Posted Sun September 27, 2020 07:56 AM

    Dear Lawrence,


    I am very thankful to you that your suggestion helped me to progress on my issue.


    ValueinField_RegEx action is able to find the match however updatefield action is updating wrong data as it runs on page level recognized data. My target is to update the field with recognized pattern which is "142864". Please advise.




    #IBMDatacap
    #Support
    #SupportMigration