ソースを参照

Improved field validation regex

marco.bellan 9 年 前
コミット
0effb96c18

+ 1 - 1
Source/BansheeEditor/Source/BsGUIFloatField.cpp

@@ -219,6 +219,6 @@ namespace BansheeEngine
 
 	bool GUIFloatField::floatFilter(const WString& str)
 	{
-		return std::regex_match(str, std::wregex(L"-?(\\d+(\\.\\d*)?)?"));
+		return std::regex_match(str, std::wregex(L"-?(\\d*(\\.\\d*)?)?"));
 	}
 }

+ 0 - 2
Source/BansheeEditor/Source/BsGUISliderField.cpp

@@ -166,8 +166,6 @@ namespace BansheeEngine
 
 	bool GUISliderField::floatFilter(const WString& str)
 	{
-		//-?(\\d+(\\.\\d*)?)?
-		//[-+]?[0-9]*\.?[0-9]*
 		bool result = std::regex_match(str, std::wregex(L"-?(\\d*(\\.\\d*)?)?"));
 		return result;
 	}