I tried creating an alert for Saryrn in potorment, but it's not useful because there are a ton of mobs in the zone named "a servant of Saryrn" so there are tons of false positive matches.
I could turn on exact matching in the options, but I don't want to do that because there are other occasions where I do want partial matches.
But I looked at the code for MySEQ and it looks like it is supposed to be using regex to match names if exact match is turned off:
Code:
if (MatchFullText)
{
if (string.Compare(mobname, str, true) == 0)
matched = true;
}
else if (isSubstring(mobname, str))
{
matched = true;
}
And the code for isSubstring:
Code:
private bool isSubstring(string toSearch, string forSearch)
{
// Compile the regular expression.
Regex regEx = new Regex(".*" + forSearch + ".*", RegexOptions.IgnoreCase);
// Match the regular expression pattern against a text string.
return regEx.Match(toSearch).Success;
}
So I tried making this alert:
Code:
<section name="Alert">
<oldfilter><regex>Name:^Saryrn</regex></oldfilter>
</section>
This should be creating a Regex object with the pattern ".*^Saryrn.*" and that pattern does match the string "Saryrn", so theoretically this should work, but it does not. What am I doing wrong?