KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


3 posters

    Extracting text from string

    avatar
    kamaelxiii


    Posts : 6
    Points : 1778
    Join date : 2019-07-11

    Extracting text from string Empty Extracting text from string

    Post by kamaelxiii Thu Sep 26, 2019 10:59 pm

    Anyone who can help me extract certain texts from a string?

    Say: 
    Contact us at (401) 739-4200 in Warwick, RI, and improve the appearance of your ... window treatments from The Window Shoppee Inc. in Warwick, Rhode Island. ... today at our location at 1517 Post RoadWarwickRI 02888 (401-739-4200)

    I just wanted to extract the orange highlighted one.
    I tried the pattern \d{3}-\d{3}-\d{4} but it's giving me an error: the pattern does not match the input.


    I tested the pattern using regex101.com and i got a full match.


    Extracting text from string Regex10
    jking
    jking


    Posts : 103
    Points : 3860
    Join date : 2014-03-01
    Location : USA

    Extracting text from string Empty Re: Extracting text from string

    Post by jking Fri Sep 27, 2019 1:53 am

    IN Kofax RPA, you would need to use parenthesis to Include the string you want and .* to Ignore the parts of the string to exclude.  

    Here is that pattern I would use:

    Test Input:
    Contact us at (401) 739-4200 in Warwick, RI, and improve the appearance of your ... window treatments from The Window Shoppee Inc. in Warwick, Rhode Island. ... today at our location at 1517 Post Road, Warwick, RI 02888 (401-739-4200)

    Pattern:
    .*(\d{3}-\d{3}\-\d{4}).*

    Test Output:
    401-739-4200
    balkrushna
    balkrushna


    Posts : 4
    Points : 2761
    Join date : 2016-10-18
    Age : 34
    Location : Pune, Maharastra

    Extracting text from string Empty Re: Extracting text from string

    Post by balkrushna Mon Feb 03, 2020 8:28 pm

    You can also try this one

    Test Input:
    Contact us at (401) 739-4200 in Warwick, RI, and improve the appearance of your ... window treatments from The Window Shoppee Inc. in Warwick, Rhode Island. ... today at our location at 1517 Post Road, Warwick, RI 02888 (401-739-4200)

    Pattern:
    .*\((.*)\).*

    Test Output:
    401-739-4200

    Sponsored content


    Extracting text from string Empty Re: Extracting text from string

    Post by Sponsored content


      Current date/time is Mon May 06, 2024 11:25 pm