I am trying to find all doubles (both positive and negative and without a specific length) in a string with Regex.Matches
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?
