in Scripts/Runtime/CallbackHandlers/WitUtteranceMatcher.cs [26:58]
protected override void OnHandleResponse(WitResponseNode response)
{
var text = response["text"].Value;
if (useRegex)
{
if (null == regex)
{
regex = new Regex(searchText, RegexOptions.Compiled | RegexOptions.IgnoreCase);
}
var match = regex.Match(text);
if (match.Success)
{
if (exactMatch && match.Value == text)
{
onUtteranceMatched?.Invoke(text);
}
else
{
onUtteranceMatched?.Invoke(text);
}
}
}
else if (exactMatch && text.ToLower() == searchText.ToLower())
{
onUtteranceMatched?.Invoke(text);
}
else if (text.ToLower().Contains(searchText.ToLower()))
{
onUtteranceMatched?.Invoke(text);
}
}