Overview
An auto-tag rule can appear to “randomly” stop matching when the rule is written as a strict RegEx whitelist and the post contains a visually-similar but different Unicode character. A common example is the difference between the black heart suit ♥️ and the red heart emoji ❤️. If your RegEx rule includes one character but the post contains the other, the rule will not match and the tag will not be applied.
Updating the RegEx rule to include the missing heart character(s) resolves the issue going forward.
Solution
To resolve auto-tagging issues caused by heart emoji character mismatches, follow these steps:
-
Identify the affected tag rule
- In Care, go to Settings > Rules and Routing > Tags.
- Open the tag that is not being applied consistently and confirm it is using a RegEx rule.
-
Confirm which heart character appears in the posts
- Compare the heart in the post text to the characters included in your RegEx. For example, ♥️ (black heart suit) and ❤️ (red heart emoji) look similar but are different Unicode characters.
-
Update the RegEx rule to include the missing heart character(s)
- If your rule currently includes only ♥️, add ❤️ (and optionally ❤ if you need to match the non-variation form).
- Example update (simplified):
- Original:
(?i)^(?:\\s*(...|👍|♥️)[!.]*\\s*)+$ - Updated:
(?i)^(?:\\s*(...|👍|♥️|❤️|❤)[!.]*\\s*)+$
- Original:
- Important: RegEx rules are typically managed by Support and shown as read-only in the UI. If you cannot edit the RegEx directly, you will need to request the update through Support.
-
Verify the behavior
- Test with sample posts (or a controlled test conversation) that include both heart characters (for example: “Beautiful ❤️” and “Beautiful ♥️”) and confirm the tag is applied.
Note: If you maintain separate Production and Development environments, apply the same RegEx update in both to keep tagging behavior consistent.
Frequently Asked Questions
- 1. How do I know if this is the reason my auto-tag rule isn’t firing?
- If the tag applies for posts using one heart character (for example, ♥️) but not for posts that contain a similar-looking heart (for example, ❤️), the rule likely needs to be updated to include the missing Unicode character.
- 2. Why do “♥️” and “❤️” behave differently if they look the same?
- They are different Unicode characters. A strict RegEx whitelist only matches the exact characters included in the pattern, so the rule must explicitly include every emoji/variant you want to match.
- 3. What if the rule still doesn’t work after adding the missing heart?
- Re-check that the updated RegEx was saved/applied in the correct environment, and validate whether the posts contain another variant (for example, ❤ vs ❤️). Also confirm the rule is not unintentionally anchored/whitelisting in a way that excludes other characters in the message.
-
References
Priyanka Bhotika
Comments