Browse Source

[regexUtils] some fixes

Exilon 3 năm trước cách đây
mục cha
commit
d07404b79f
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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;