diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index b8080ec573..122f104ef8 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -64,7 +64,8 @@ namespace OpenSim.Framework private static readonly DateTime unixEpoch = DateTime.ParseExact("1970-01-01 00:00:00 +0", "yyyy-MM-dd hh:mm:ss z", DateTimeFormatInfo.InvariantInfo).ToUniversalTime(); - private static readonly Regex UUIDPattern = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); + public static readonly Regex UUIDPattern + = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); #region Vector Equations @@ -799,6 +800,11 @@ namespace OpenSim.Framework y += ry; } + /// + /// Is the given string a UUID? + /// + /// + /// public static bool isUUID(string s) { return UUIDPattern.IsMatch(s); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index b520642fb4..1fbc20fe1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -53,14 +53,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver protected Scene m_scene; protected string m_savePath; - /// - /// Used for identifying uuids embedded in scripts - /// - protected static readonly Regex m_uuidRegex - = new Regex( - "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", - RegexOptions.Compiled); - /// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate /// asset was found by the asset service. @@ -136,7 +128,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { string script = Utils.BytesToString(scriptAsset.Data); //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); - MatchCollection uuidMatches = m_uuidRegex.Matches(script); + MatchCollection uuidMatches = Util.UUIDPattern.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); foreach (Match uuidMatch in uuidMatches)