private String ExtractTag(PlayerModel m)
{
if (m == null) return String.Empty;
String tag = m.Tag;
if (String.IsNullOrEmpty(tag)) {
// Maybe they are using [_-=]XXX[=-_]PlayerName[_-=]XXX[=-_] format
Match tm = Regex.Match(m.Name, @"^[=_\-]*([^=_\-]{2,4})[=_\-]");
if (tm.Success) {
tag = tm.Groups[1].Value;
} else {
tm = Regex.Match(m.Name, @"[^=_\-][=_\-]([^=_\-]{2,4})[=_\-]*$");
if (tm.Success) {
tag = tm.Groups[1].Value;
} else {
tag = String.Empty;
}
}
}
return tag;
}