I’m having a problem trying to understand how does AIML pattern matching works.
What’s the difference between _ and *? And how I should use them to get the best match?
I have this document only, but it lacks some good examples.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A * will match anything unless a pattern of a word or several words are matched
A _ will match anything even if a pattern of a word or several words could match
<pattern>BYE _</pattern>does not make sense since<pattern>BYE *</pattern>matches the same patterns but<pattern>BYE _</pattern>will shadow<pattern>BYE * SEE YOU</pattern>whereas BYE * won’t.Use _ carefully, for example _ would match anything and your bot will give the same answer every times.
<pattern>_ A COUPLE OF WORDS *</pattern>and<pattern>_ A COUPLE OF WORDS</pattern>is the proper way to use _ if you want to catch every times A COUPLE OF WORDS is inside or at the end of a sentence.