Basic keyword matching ("interested", "price") captures the obvious leads. But real WhatsApp group conversations are messy — typos like "intrested", variations like "how much vs. cost vs. price", and multi-language messages. Competitors' simple keyword filters miss 30-40% of qualified leads because they can't handle this complexity. MoltFlow's advanced WhatsApp keyword automation rules use regex patterns, typo tolerance, and AND/OR logic to catch every lead signal — not just the perfect ones.
What You'll Need
Before starting, make sure you have:
- At least one monitored group — If you haven't set up WhatsApp group monitoring yet, follow the group monitoring guide first (takes 10 minutes).
- Growth or Business plan — Advanced keyword rules (regex, AND/OR logic) require a paid plan (starts at $39/month). Customers report capturing 30% more leads with regex vs. basic keywords — that's 3-9 extra qualified leads per month.
- Example group messages — Pull 10-20 recent messages from your target group to test against. This helps you build accurate rules.
Step 1: Navigate to Lead Detection Settings
WhatsApp keyword automation rules are configured per group, not globally. Each group can have different rules tailored to its niche.
Open Group Rules
- Go to Groups → Monitored Groups in your dashboard
- Click on a group name to open details
- Navigate to the Lead Rules tab
- You'll see a list of existing rules (if any) and an "Add Rule" button
This is where you'll create and manage all keyword rules for this group.
Understanding the Rules Engine
Each rule defines:
- What to match (keyword or pattern)
- How to match (exact, contains, starts with, regex)
- Case sensitivity (case-insensitive recommended)
- Active status (enabled/disabled — useful for testing)
When a message arrives, MoltFlow evaluates all active rules. If any rule matches, the sender is captured as a lead.
Step 2: Create Your First Keyword Rule
Let's start with a simple rule to catch purchase intent.
Add a Basic Rule
- Click "Add Rule"
- Fill in the form:
- Keyword:
interested - Match type:
contains - Case insensitive: ✓ (checked)
- Status:
active
- Keyword:
- Click Save
Done. This rule now matches any message containing "interested" (case-insensitive).
Match Types Explained
Contains (most common):
- Matches keyword anywhere in the message
"interested"matches: "I'm interested in this", "very interested", "INTERESTED!!!"- Use this for general keywords
Exact:
- Matches only if the entire message is exactly the keyword (no other words)
"yes"matches: "yes" (entire message)"yes"doesn't match: "yes, I'm interested" (has other words)- Rarely used — too restrictive
Starts with:
- Matches only if the message begins with the keyword
"looking for"matches: "looking for a 2-bedroom apartment""looking for"doesn't match: "I am looking for a house"- Good for catching specific question formats
Regex (advanced):
- Matches using regular expression patterns
- Most powerful, most complex
- See Step 3 for details
Case Sensitivity
Always use case-insensitive matching unless you have a specific reason not to. Group messages use random capitalization:
- "Interested"
- "INTERESTED"
- "interested"
- "IntErEsTeD" (unlikely, but it happens)
Case-insensitive catches all of these with one rule.
Test Your Rule
After saving, scroll down to the "Test Rule" section. Paste a sample message and click Test. MoltFlow shows which rules match.
Example test message:
Hi everyone! I'm very interested in buying a 2-bedroom apartment.
Budget is around $200k. Anyone know of good options?If your "interested" rule is set up correctly, it should match this message.
Step 3: Use Regex Patterns for Advanced WhatsApp Lead Capture
Regex (regular expressions) lets you match complex patterns — variations, typos, multiple keywords in one rule. This is where MoltFlow's WhatsApp keyword automation outperforms competitors' basic filters.
When to Use Regex
Use regex when:
- You want to match multiple similar keywords in one rule (
price|cost|how much) - You need to handle typos or variations (
inter[e]?stedmatches both "interested" and "intrested") - You want word boundaries to avoid false positives (
\byes\bmatches "yes" but not "yesss") - You need multi-word patterns with flexible spacing (
looking\s+for\s+\w+)
Don't use regex if a simple "contains" rule works. Regex is harder to debug.
Regex Example 1: Multiple Keywords (OR Logic)
Goal: Match "price", "cost", or "how much" in one rule.
Regex pattern: price|cost|how much
Matches:
- "What's the price?"
- "How much does it cost?"
- "Tell me the cost"
Why this works: The pipe | means "or". The pattern matches if any of the three phrases appear.
Regex Example 2: Word Boundaries (Avoid False Positives)
Problem: Simple keyword "yes" matches "yesss", "yesterday", "eyes" — lots of false positives.
Solution: Use word boundaries: \byes\b
Matches:
- "yes"
- "Yes, I'm interested"
- "Is it available? yes"
Doesn't match:
- "yesterday"
- "yesss"
- "eyes"
Why this works: \b marks a word boundary (start/end of a word). \byes\b only matches "yes" as a complete word.
Regex Example 3: Flexible Spacing
Goal: Match "looking for" even if there are multiple spaces or tabs.
Regex pattern: looking\s+for
Matches:
- "looking for"
- "looking for" (double space)
- "looking for" (triple space)
Why this works: \s+ matches one or more whitespace characters (spaces, tabs, newlines).
Regex Example 4: Typo Tolerance
Goal: Match "interested" even if typed as "intrested" (common typo — missing "e").
Regex pattern: inte?rested
Matches:
- "interested" (correct spelling)
- "intrested" (typo)
Why this works: ? makes the preceding character optional. e? means "e is optional", so both spellings match.
Testing Regex Before Deploying
Use regex101.com to test patterns before adding them to MoltFlow. Paste your regex in the pattern box, add test messages, and see what matches.
Select "JavaScript" flavor (MoltFlow uses JavaScript regex engine).
Regex Performance Warning
Complex regex patterns slow down message processing. If a group sends 100 messages per minute and you have 20 complex regex rules, you might see delays.
Good practice:
- Use simple "contains" rules when possible
- Combine multiple keywords into one regex with
|(OR logic) - Avoid overly broad patterns like
.*(matches everything — useless and slow)
Step 4: Set Up Multi-Keyword Rules with AND/OR Logic
Sometimes you want to match messages that contain multiple keywords (AND logic) or any of several keywords (OR logic).
OR Logic (Any Keyword Matches)
OR logic is built into regex: price|cost|how much
This matches if the message contains "price" OR "cost" OR "how much". One match is enough.
AND Logic (All Keywords Must Match)
AND logic requires multiple rules working together. MoltFlow doesn't natively support AND within a single rule, but you can achieve this with regex lookaheads (advanced).
Goal: Match messages that contain BOTH "interested" AND "price".
Regex pattern (lookahead): (?=.*interested)(?=.*price).*
Matches:
- "I'm interested. What's the price?"
- "Price looks good. Very interested."
- "Interested in knowing the price range"
Doesn't match:
- "I'm interested" (missing "price")
- "What's the price?" (missing "interested")
Why this works:
(?=.*interested)— Lookahead: ensure "interested" appears somewhere(?=.*price)— Lookahead: ensure "price" appears somewhere.*— Match the entire message (required for lookaheads to work)
When to Use AND Logic
Use AND logic to filter for serious buyers. Someone who says "interested" might be browsing. Someone who says "interested" AND "price" is closer to buying.
E-commerce example: (?=.*buy)(?=.*urgent).* — matches only messages with both "buy" and "urgent".
Real estate example: (?=.*apartment)(?=.*budget).* — matches only messages with both "apartment" and "budget".
OR vs AND Trade-offs
OR logic (simple):
- Casts a wide net
- Captures more leads
- More false positives
AND logic (complex):
- Filters for high-intent leads
- Captures fewer leads
- Fewer false positives
Start with OR logic. Add AND logic if you're drowning in false positives.
Step 5: Test Your Rules Against Sample Messages
Before activating a rule, test it against real group messages.
Collect Sample Messages
- Open WhatsApp on your phone
- Navigate to the target group
- Copy 10-20 recent messages (mix of leads and non-leads)
- Paste them into a text file
These samples represent real traffic. Your rules need to handle them.
Test in the Dashboard
- Go to Groups → Monitored Groups → group name → Lead Rules tab
- Scroll to the "Test Rules" section at the bottom
- Paste a sample message
- Click Test
- MoltFlow shows which rules matched (if any)
Example Test Messages
Message 1 (should match):
Hi! I'm looking for a 2-bedroom apartment in downtown. Budget is $2000/month.
Anyone has recommendations?Expected matches: "looking for", "budget", "apartment", "bedroom"
Message 2 (should NOT match):
Good morning everyone! Hope you all have a great day.Expected matches: None (no purchase intent)
Message 3 (should match with typo tolerance):
Very intrested! Can you send me more details about the price?Expected matches: inte?rested, price|cost|how much
Message 4 (false positive to avoid):
YesExpected matches: None (unless you use \byes\b with AND logic for context)
Iterate Based on Results
If a rule matches too many non-leads (false positives), make it more specific:
- Add word boundaries (
\b) - Switch from "contains" to "starts with"
- Add AND logic (require multiple keywords)
If a rule misses real leads (false negatives), make it broader:
- Add typo tolerance (
inte?rested) - Add synonyms with OR logic (
price|cost|how much) - Switch from "exact" to "contains"
Keyword Rule Templates
Here are ready-to-use templates for common industries.
E-commerce (Product Sales)
Basic purchase intent:
- Keyword:
interested|buy|purchase|order|get - Type:
regex - Case insensitive: ✓
Price inquiries:
- Keyword:
price|cost|how much|what.*price - Type:
regex - Case insensitive: ✓
Product availability:
- Keyword:
available|in stock|stock - Type:
contains - Case insensitive: ✓
Real Estate
Property search:
- Keyword:
looking for|need|want|searching for - Type:
regex - Case insensitive: ✓
Budget mentions:
- Keyword:
budget|afford|price range|\$\d+ - Type:
regex - Case insensitive: ✓
Property specs:
- Keyword:
\d+[- ]?bedroom|bedroom|bathroom|sq\.? ?ft - Type:
regex - Case insensitive: ✓
Services (Consulting, Freelancing)
Help requests:
- Keyword:
need help|looking for|recommend|can anyone - Type:
regex - Case insensitive: ✓
Project inquiries:
- Keyword:
project|hire|work with|collaborate - Type:
contains - Case insensitive: ✓
Budget discussions:
- Keyword:
budget|cost|rate|charge - Type:
contains - Case insensitive: ✓
Lead Generation (B2B)
Interest signals:
- Keyword:
interested|tell me more|learn more|more info - Type:
regex - Case insensitive: ✓
Contact requests:
- Keyword:
contact|reach out|get in touch|dm me - Type:
regex - Case insensitive: ✓
Quote requests:
- Keyword:
quote|proposal|estimate|pricing - Type:
contains - Case insensitive: ✓
Troubleshooting
Regex Doesn't Match Expected Messages
Problem: You tested the regex on regex101.com and it worked, but in MoltFlow it doesn't match.
Possible causes:
- Wrong flavor — MoltFlow uses JavaScript regex. Make sure regex101.com is set to "JavaScript" (not Python, PCRE, etc.)
- Message preprocessing — MoltFlow may trim whitespace or normalize Unicode. Test with exact message text from your group.
- Typo in the pattern — Copy-paste the pattern from regex101.com into MoltFlow to avoid transcription errors.
Solution: Use the dashboard "Test Rules" feature with the actual group message text.
Too Many False Positives
Problem: Rules capture messages that aren't leads.
Examples:
- "yes" matches "yesterday"
- "price" matches "priceless" (someone's name)
Solution:
- Add word boundaries:
\byes\b,\bprice\b - Use AND logic to require multiple keywords
- Switch from "contains" to "starts with" or "exact"
No Leads Captured Despite Active Rules
Problem: Rules are active, group is monitored, but no leads appear.
Possible causes:
- Group is inactive — No messages = no leads. Check the group for recent activity.
- Rules are too specific — If you require 5 keywords with AND logic, almost no message will match.
- Messages are old — MoltFlow only processes new messages. Old messages before monitoring started aren't captured.
Solution:
- Check that the group has recent messages (last 24 hours)
- Simplify rules — start with basic "contains" keywords like "interested", "price"
- Wait 24-48 hours for new messages to arrive
Regex Errors in Dashboard
Problem: When you save a regex rule, MoltFlow shows "Invalid regex pattern".
Solution: Your regex has a syntax error. Common mistakes:
- Unescaped special characters (
$,^,*,+,?,(,),[,],{,},|,\) - Unmatched parentheses or brackets
- Invalid escape sequences
Copy your pattern into regex101.com to debug.
What's Next?
Now that you have advanced WhatsApp keyword automation rules, you're ready to:
- Monitor WhatsApp groups for leads — Apply your rules to multiple groups for 10-30 qualified leads/month
- Qualify leads with OpenClaw agents — AI agents score leads based on keyword matches (Business plan)
- Send bulk messages to leads — Reach out with templates based on the keyword they matched (Business plan)
- Organize leads into custom groups — Segment by intent level (high-intent AND logic vs. browsing OR logic)
All of these features are available now in your MoltFlow dashboard. Check the sidebar to explore.
Ready to unlock advanced WhatsApp keyword automation and capture 30% more leads? Join 500+ businesses using MoltFlow for lead generation. Regex rules capture typos, variations, and multi-language messages that competitors miss. Start your 14-day Growth trial — no credit card required.
Still stuck? Contact support via the dashboard chat or email us at [email protected]. We typically respond within 2-4 hours.