public static _Parameter[] Paramparser_NameValue(string source,string[] expressions)
{
string tmp = source.Trim();
ArrayList param = new ArrayList();
foreach(string exp in expressions){
Regex r = new Regex(exp,RegexOptions.IgnoreCase);
Match m = r.Match(tmp);
if(m.Success){
param.Add(new _Parameter(m.Result("${param}").Trim(),m.Result("${value}")));
// remove matched string part form tmp
tmp = tmp.Replace(m.ToString(),"").Trim();
}
}
// There are some unparsed params, add them as UnParsed
if(tmp.Trim().Length > 0){
param.Add(new _Parameter("UNPARSED",tmp));
}
_Parameter[] retVal = new _Parameter[param.Count];
param.CopyTo(retVal);
return retVal;
}