UnityEditor.PListConfig.GetRegex C# (CSharp) Method

GetRegex() private static method

private static GetRegex ( string paramName ) : Regex
paramName string
return System.Text.RegularExpressions.Regex
        private static Regex GetRegex(string paramName)
        {
            return new Regex("(?<Part1><key>" + paramName + @"</key>\s*<string>)(?<Value>.*)</string>");
        }

Usage Example

示例#1
0
 public string this[string paramName]
 {
     get
     {
         Match match = PListConfig.GetRegex(paramName).Match(this.xml);
         return((!match.Success) ? string.Empty : match.Groups["Value"].Value);
     }
     set
     {
         Match match = PListConfig.GetRegex(paramName).Match(this.xml);
         if (match.Success)
         {
             this.xml = PListConfig.GetRegex(paramName).Replace(this.xml, "${Part1}" + value + "</string>");
         }
         else
         {
             this.WriteNewValue(paramName, value);
         }
     }
 }