Explorar o código

[regexUtils] some fixes

Exilon %!s(int64=3) %!d(string=hai) anos
pai
achega
d07404b79f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Quick.RegEx.Utils.pas

+ 2 - 2
Quick.RegEx.Utils.pas

@@ -92,12 +92,12 @@ implementation
 
 class function TRegExUtils.IsNumber(const aValue: string): Boolean;
 begin
-  Result := TRegEx.IsMatch(aValue,'^\d*(\.\d+)?$');
+  Result := TRegEx.IsMatch(aValue,'^(-|)\d*(\.\d+)?$');
 end;
 
 class function TRegExUtils.IsFloat(const aValue: string): Boolean;
 begin
-  Result := TRegEx.IsMatch(aValue,'^\d*\.\d+$');
+  Result := TRegEx.IsMatch(aValue,'^(-|)\d*\.\d+$');
 end;
 
 class function TRegExUtils.IsInteger(const aValue: string): Boolean;