Regular Exp

Hi Team,

I multiple row lines say
01 12/12/2000 12345 Today is Monday 123.00- Test
01 12/12/2000 12345 Today is Monday 123.00- Test
01 12/12/2000 12345 Today is Monday 123.00- Test

Using below regx i am extracting and it works fine.
System.Text.RegularExpressions.Regex.Match(item.ToString,"[\d.]±").Value.ToString

which extracts only 123.00- from each row

Problem is its not extracting correctly when value is .50
How modify the regx when we get values like above (.10) That is irrespective of whatever value it has got before decimal
it should return the values even if it is blank like .10 it should read the text value

Hi,

Your current pattern is "[\d.]+-", isn’t it?

How about the following pattern, if decimal point always exists?

"\d*\.\d+"

Regards,

1 Like

hi,