Fix regex for string->int cast to accept leading spaces and a sign

This commit is contained in:
Melanie Thielker
2008-09-02 06:43:16 +00:00
parent 14a218dbc9
commit f13a48fe1c

View File

@@ -1394,7 +1394,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
static public explicit operator LSLInteger(string s)
{
Regex r = new Regex("^[0-9][0-9]*");
Regex r = new Regex("^[ ]*-?[0-9][0-9]*");
Match m = r.Match(s);
string v = m.Groups[0].Value;