Forum Discussion

akilan's avatar
akilan
Occasional Contributor
2 years ago

REgex to capture number

I have a text response Example" Call 950000 saved". I need to capture only number "950000" and have to assign this to a variable.

What regex we use to capture only the number from above sentence..

 

Thanks in advance,

Akil

  • Here's an example which displays number(s) in the first paragraph using regular expression,

     

    • akilan's avatar
      akilan
      Occasional Contributor

      thanks for the response. 

      I can see the way the regular exp works in the documentation. I'm using keyword test here and I want extract the number from the output(Call 950000 saved, need to capture only 95000).

      Where do we put the regular exp syntax..is it while performing set variable value or during log message?

      any example would be helpful.

       

      Thanks,

      Akilan

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Here's an example which displays number(s) in the first paragraph using regular expression,

     

    • akilan's avatar
      akilan
      Occasional Contributor

      Many thanks, appreciate your time.