[Mono-list] Regex Help..
Sijmen Mulder
Sijmen Mulder <sjmulder@gmail.com>
Sat, 25 Sep 2004 16:56:51 +0200
> yyy.xxx.zzz:key1=val1,key2=val2,key3=val3
-- code --
string someString = "yyy.xxx.zzz:key1=val1,key2=val2,key3=val3";
string[] parts = someString.Split(':'); // parts[0] is now domain
if(parts.Length!=2) return null;
string[] keyvals = parts[1].Split(',')
Hashtable data = new Hashtable();
foreach(string keyval in keyvals)
{
string[] temp = keyval.Split('=');
if(temp.Length!=2) return null;
data.Add(temp[0], temp[1]);
}
-- /code --
Now, parts[0] contains the domain, and data is a hastable of keys and data.
--
'May the Lord bless you and protect you. May the Lord smile on you
and be gracious to you. May the Lord show you his favor and give you
his peace.'
'De Heer zegent je, en Hij bewaart je. De Heer kijkt met liefde naar
je, en Hij is je genadig. De Heer bedenkt het goede voor je, en geeft
je vrede.'
Sijmen Mulder