diff options
author | Sean Dague | 2007-10-22 16:41:53 +0000 |
---|---|---|
committer | Sean Dague | 2007-10-22 16:41:53 +0000 |
commit | f1fec04c56ddbfe9283c48f900e4b52f6e79a687 (patch) | |
tree | a10eb940a825051424f1d2913c1b5866da9dafd8 /OpenSim/Region/Environment/Modules/ChatModule.cs | |
parent | make for nicer IRC messages. No promiss that this works yet, but (diff) | |
download | opensim-SC-f1fec04c56ddbfe9283c48f900e4b52f6e79a687.zip opensim-SC-f1fec04c56ddbfe9283c48f900e4b52f6e79a687.tar.gz opensim-SC-f1fec04c56ddbfe9283c48f900e4b52f6e79a687.tar.bz2 opensim-SC-f1fec04c56ddbfe9283c48f900e4b52f6e79a687.tar.xz |
my confusion on matches vs. groups in regex. This should work a bit better
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ChatModule.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 5a31e0b..f60b5ff 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -326,12 +326,12 @@ namespace OpenSim.Region.Environment.Modules | |||
326 | Regex RE = new Regex(regex, RegexOptions.Multiline); | 326 | Regex RE = new Regex(regex, RegexOptions.Multiline); |
327 | MatchCollection matches = RE.Matches(input); | 327 | MatchCollection matches = RE.Matches(input); |
328 | // Get some direct matches $1 $4 is a | 328 | // Get some direct matches $1 $4 is a |
329 | if (matches.Count == 4) { | 329 | if ((matches.Count == 1) && (matches[0].Groups.Count == 4)) { |
330 | result = new Dictionary<string, string>(); | 330 | result = new Dictionary<string, string>(); |
331 | result.Add("nick", matches[0].Value); | 331 | result.Add("nick", matches[0].Groups[0].Value); |
332 | result.Add("user", matches[1].Value); | 332 | result.Add("user", matches[0].Groups[1].Value); |
333 | result.Add("channel", matches[2].Value); | 333 | result.Add("channel", matches[0].Groups[2].Value); |
334 | result.Add("msg", matches[3].Value); | 334 | result.Add("msg", matches[0].Groups[3].Value); |
335 | } else { | 335 | } else { |
336 | m_log.Verbose("IRC", "Number of matches: " + matches.Count); | 336 | m_log.Verbose("IRC", "Number of matches: " + matches.Count); |
337 | } | 337 | } |