Extract Number from a string

Hi All,

I’m trying to extract the number from a string and the number may be of decimal type(1.3) or ranged number(1-3) or a single number (1).

Examples:-

  1.           "getting the value
                   like 1-3."
    
  2. "A value may be 
      consider as 2.6"
1 Like

You can use regex expression to get the numbers from string.

\d[.-].

Thanks
@saneeth_kandukuri

Use this below regex and check,
β€œ[0-9A-Z\W]+\d+”
Check this workflow,
Main (3).xaml (6.9 KB)

1 Like

@Manish540
Thank you for your workflow, it almost worked well for most of the records, but it is not extracting the β€œ):”
Example:-
β€œat reach of
of max length(~ m):2-3”
Output:- ):2-3

Try this regex:

β€œ((\d+.\d+)|(\d+-\d+)|(\d))”

Regex.xaml (8.1 KB)

Thanks! @saneeth_kandukuri

3 Likes

Thanks

Regex

(?<=: )(\d+)(.*\n)(?=Error Message :The code is not generated)

Thanks
@saneeth_kandukuri

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.