E.g. if I have this string
-,2 20 30 5 -5 -5, -55, -55.6
I should find
-,2 20 30 5 -5 -55.6

On 17 Jun., 09:19, Stefan Brandt <[email protected]> wrote:
> What are you trying to achieve?
>
> Only positive numbers?
>
> if so...
>
> Try with this
>
> (^\d*\.?\d*[1-9]+\d*$)|(^[1-9]+\d*\.\d*$)
>
> Positive decimals, for example 231.33
> 0.1 is accepted but 0 or 0.0 is not accepted
>
> or
>
> with integers:
>
> ^\d{1,5}$
>
> Positive integer from 0 to 99999 (zero is also accepted). 5 describes
> the length....if it would be 6 ->  0 to 999999
>
> On Jun 16, 12:34 pm, The87Boy <[email protected]> wrote:
>
>
>
> > I am using C# Regular Expression to parse some numbers, but I can't
> > find the problem in my Regular Expression as it accepts "-2," but it
> > should not
> > My Regular Expression is @"([+|-]?)(\d*)([\.|,]?)(\d+)"
> > Can everybody tell me how to correct this problem?

Reply via email to