Tutorial · 5 min read

How Keyword Matching Actually Works, Character by Character

The PostEngage teamEngineering and support ·
The comment-to-DM flow: a keyword comment, a public reply, and the private thread it opens.

Almost every argument about keyword triggers is really an argument about which words to pick, and that has its own post. This one is underneath it. It is the reference for what the matcher does to a comment before it decides whether your automation fires, because half the keyword lists that fail were built on a wrong guess about that.

The short version is that a trigger is a string comparison. It does not read the comment, it does not know what the words mean, and it has no opinion about intent. It normalises a few things, then looks for your entries as whole words.

Whole words, which is the rule people get wrong most

price does not match pricing. It does not match prices either. The comparison looks for your entry as a complete word, so anything with a suffix is a different string and needs its own entry.

This is deliberate rather than a limitation to work around. Substring matching would mean a keyword of buy firing on buying, buyer and also on the word buys inside a sentence about somebody else. Whole-word matching is the version where you can predict what happens.

The practical consequence is that endings are your job:

  1. Plurals are separate entries. size and sizes. link and links. Both, always, because your audience uses both.
  2. Verb forms are separate entries. book does not cover booking. order does not cover ordering.
  3. Hindi and Hinglish endings are separate entries. kitna, kitne, kitni are three strings. There is no stem the matcher shares between them.
  4. A multi-word entry is one keyword. kitne ka is a single entry and the whole phrase has to be there. It is not two keywords that happen to sit next to each other.
The automation builder with the trigger section open, showing the keyword list and the preview panel replaying real comments against it.
The preview panel is the only honest test of a keyword list. It runs the comparison described in this post against comments you already received.

What is folded away before the comparison

Three normalisations happen to both the comment and your entries, so you never need to list variants for them.

Case. PRICE, Price and price are one keyword. Write the caption in caps because it reads as an instruction, and stop thinking about it after that.

Punctuation and spacing. price?, price!!!, price. and price all match. Emoji and invisible characters come out too, so price 🔥 matches. This includes the hash, which is worth stating separately because of what it does under a giveaway post: #price matches a keyword of price. If your list contains free, contest or giveaway, a comment consisting of nothing but hashtag spam will fire your automation.

Latin accents. café matches an entry of cafe, and espanol matches español. This applies to accented Latin letters and to nothing else.

What never folds, and is therefore list work

Script, language and spelling. price and कीमत are unrelated strings. dam and daam are unrelated strings, because transliteration has no standard spelling and your audience uses every version of it. Misspellings are unrelated strings, which is why pric and prize belong in a real price list rather than in a note about tidying it up later.

The matcher is not clever and is not trying to be. Everything it appears to understand, you typed into a list.

For an inbox that runs in more than one language, the multilingual post covers how to build that list without it becoming unmanageable.

Any-of and all-of, as set logic

Any-of fires when at least one entry from your list appears. That is the mode most automations want, because a list of eleven spellings of the same question only works if any one of them is enough.

All-of fires only when every entry appears somewhere in the same comment. They do not have to be adjacent and they do not have to be in order — the test is presence, across the whole comment. It is a narrowing tool for a word doing double duty, not a stricter grade of the same setting.

Negative keywords are a veto, not a score

A negative entry that appears anywhere in the comment stops the reply, whatever else matched. There is no weighing up, no threshold, and no case where a strong positive match beats a negative one. That is what makes the field trustworthy: not interested, refund, payment failed, nahi chahiye mean silence, reliably.

Negative keywords are matched the same way as positive ones. Whole words, case and punctuation folded, no stemming. So refund does not cover refunded, and if your complaint vocabulary matters — it does — write both.

The order everything happens in

This is the part that changes how you spend your attention.

Matching runs first. If nothing matches, the comment produces nothing at all: no reply, no credit, no run to inspect afterwards. It is not blocked, because a block is a decision about a reply that was going to happen. It simply never started.

Only after a match do the ten checks run, in their fixed order, and only after those does anything get written. Which means the model never sees a comment that failed to match, and improving the reply text does nothing whatsoever for coverage. Coverage is the keyword list and only the keyword list. The full order of the checks is documented separately, and it is worth knowing which stage you are looking at when something does not arrive.

A test result showing the matched keyword, the public reply and the private reply that would have been sent.
A test that never fires is the clearest signal there is that the comparison did not go the way you assumed.

How to check your list rather than reason about it

Run Test on myself with a comment you have actually received, typed exactly as the person typed it. If it fires, the comparison agrees with you. If it does not, one of the rules above is the reason, and it is nearly always the whole-word one.

Then go live on a single post and read the comments that arrived that evening as strings rather than as sentences. Every spelling you did not have is a person who asked and got nothing, and adding it takes ten seconds. Choosing the word in the first place is the other half of this, and it is the half that decides how much of this mechanics ever matters.

One email when we publish.

No drip sequence, no “quick question” follow-up. Unsubscribe is one click and we honour it immediately.

Try it on your own posts

Free forever. Three minutes to set up.

Start free