-
Notifications
You must be signed in to change notification settings - Fork 1
Regex Workflow Templates
These regex/workflow examples were originally collected on the SpamBlocker wiki. The regex/workflow engine works the same way here, so they apply directly to SpamBlocker Extended too.
This page is contributed by: @Fred-Vatin, @JEAYNE, @Lindvorn, @Malachiel87, @Ofboir, @Percherie, @PocketFR, @hayvan96, @lucasmz-dev, @raphaeldore, @revanmj, @vanek49
If you'd like to share your regex/workflow here, please check this guide.
^(\+55|0)303\d{7}$Important
🇬🇧 Make sure the "Raw number" option is enabled in the regex flags.
🇧🇷 Certifique-se que a opção "Número bruto" está ativada nas flags de regex.
More info: https://www.gov.br/anatel/pt-br/regulado/numeracao/telemarketing-ativo-prefixo-0303
{
"id": 2,
"desc": "Dois-je répondre?",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": "^(?:\\+33|33|0)?\\d{9}$"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://www.doisjerepondre.fr/numero-de-telephone/0{domestic}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"strategy": "DirectVerdict",
"negativeSig": "<div class=\"score negative\"><\/div>",
"negativeFlags": 5,
"positiveSig": "<div class=\"score positive\"><\/div>",
"positiveFlags": 5,
"categorySig": "Cat[eé]gories.*<li class='active.*?'>\\d+x ([a-zA-Z0-9'éèàêâç\/ ]+)<\/li>",
"categoryFlags": 1029
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}^(?:33)?(16[23]|268[89]|27[01]|37[78]|42[45]|56[89]|598[7-9]|947[5-9]|94[89])\d{5,6}$
N’utilisez aucun flag RegEx.
Les numéros de démarchage sont encadrés par l’ARCEP. Il doivent utiliser un certain schéma défini ici. Ils sont labellisés tels que : Numéros polyvalents vérifiés (pouvant être utilisés comme numéro d’appelant par des systèmes automatisés d’appels et d’envoi de messages). Ainsi, ils sont facilement identifiables puisque commençant toujours par certains numéros.
En ajoutant cette RegEx, tous ces numéros sont bloqués. Ils sont responsables de la très grande majorité des appels indésirables.
^(33)?(64466|64467|64468|64469|7568|7569)\d{4,5}$
| Region | valid regex |
|---|---|
| Guadeloupe, Saint-Martin et Saint-Barthélemy | ^(?:590|0)9475\d{5}$ |
| Guyane | ^(?:594|0)9476\d{5}$ |
| Martinique | ^(?:596|0)9477\d{5}$ |
| La Réunion, Mayotte et autres territoires de l’Océan Indien | ^(?:262|0)(?:9478|9479)\d{5}$ |
Source: This pdf published by ARCEP. Jump to: Annexe N°1, Chapter 2.3.7 "Conditions spécifiques aux numéros polyvalents vérifiés", Page 23/65.
Based on the original French SIA workflow i converted it for make it work with italy numbers (Chi le ha chiamato)
{
"id": 6,
"desc": "SIA Italy",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": ".*"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://www.chistachiamando.it/numero-telefono/{domestic}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "\\dx negativa",
"negativeFlags": 5,
"positiveSig": "\\dx positiva",
"positiveFlags": 5,
"categorySig": "NEGATIVA ([A-Z]+)",
"categoryFlags": 1029
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}
{
"id": 1,
"desc": "odebractelefon.pl",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": ".*"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://www.odebractelefon.pl/numer-telefonu/{domestic}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "\\dx negatywna",
"negativeFlags": 5,
"positiveSig": "\\dx pozytywna",
"positiveFlags": 5,
"categorySig": "Kategoria[\\S\\s]*\\dx ([a-zA-Z0-9' ]+)</li>",
"categoryFlags": 1029
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}
{
"id": 6,
"desc": "[www.telefonnyjdovidnyk.com.ua](http://www.telefonnyjdovidnyk.com.ua/)",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": "\\d+"
},
{
"type": "HttpDownload",
"method": 0,
"url": "[https://www.telefonnyjdovidnyk.com.ua/nomer/{number](https://www.telefonnyjdovidnyk.com.ua/nomer/%7Bnumber)}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "Ступінь небезпеки.*((?:7|8|9|10)\\d) %</span>",
"negativeFlags": 5,
"positiveSig": "Ступінь небезпеки.*((?:0|1|2)?\\d) %</span>",
"positiveFlags": 5
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}
{
"id": 5,
"desc": "CallFilter",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": ".*"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://callfilter.app/{number}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "\\dx негативні",
"negativeFlags": 5,
"positiveSig": "\\dx позитивні",
"positiveFlags": 5,
"categorySig": "Categories.*?\\d+x ([a-zA-Zа-яА-Я0-9' ]+)</li>",
"categoryFlags": 1029,
"categoryMapping": ""
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}
Warning
Charges will apply once the Gemini free tier quota is exceeded. This usually won't happen unless you get flooded with a massive number of messages
Here is how to screen SMS messages using gemini flash 3.5 :
- Create API key: https://aistudio.google.com/app/api-keys
- Replace the
_______YOUR_API_KEY________below with your key
{
"type": "QueryApi",
"id": 1,
"desc": "Gemini AI",
"actions": [
{
"type": "InterceptSms"
},
{
"type": "HttpDownload",
"method": 1,
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent",
"header": "Content-Type: application/json\nx-goog-api-key: _______YOUR_API_KEY________",
"body": "{\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"You are a strict categorization bot. You must respond with EXACTLY ONE WORD from this list: Political, Fraud, Survey, Marketing, or Valid. No explanations, no markdown, no punctuation.\"\n }\n ]\n },\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"Categorize this SMS message: {escape({sms})}\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"temperature\": 0.0,\n \"maxOutputTokens\": 150\n }\n}",
"enableRetry": false,
"retryTimes": 0,
"retryDelayMs": 0
},
{
"type": "ParseQueryResult",
"negativeSig": "\"text\":\\s*\"(Political|Fraud|Survey|Marketing)",
"negativeFlags": 0,
"positiveSig": "\"text\":\\s*\"Valid",
"positiveFlags": 0,
"categorySig": "\"text\":\\s*\"([A-Za-z]+)",
"categoryFlags": 0,
"commentSig": "",
"commentFlags": 0,
"categoryMapping": ""
}
],
"enabled": true
}- Import the modified json into SpamBlocker:
Query API section -> New -> Import
^(\+|00)(212|213|216|218|222)\d+$
Important
Only useful if you reside OUTSIDE the Maghreb and receive some spams from there.
Enable the Raw Number flag as in the screenshot below. This should prevent issues with local numbers in their national format.
This RegEx matches those countries:
| Country | Country Code |
|---|---|
| Algeria | +213 |
| Libya | +218 |
| Mauritania | +222 |
| Morocco | +212 |
| Tunisia | +216 |
{
"id": 7,
"desc": "CallFilter",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": ".*"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://callfilter.app/{number}",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "\\dx negative",
"negativeFlags": 5,
"positiveSig": "\\dx positive",
"positiveFlags": 5,
"categorySig": "Categories.*1x ([a-zA-Z0-9' ]+)</li>",
"categoryFlags": 1029
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}
Use Tellows API (You can adjust the domain name to your country)
{
"id": 1,
"desc": "Tellows",
"actions": [
{
"type": "ParseIncomingNumber",
"numberFilter": ".*"
},
{
"type": "HttpDownload",
"method": 0,
"url": "https://www.tellows.com/basic/num/%2B{cc}{domestic}?json=1",
"header": "",
"body": ""
},
{
"type": "ParseQueryResult",
"negativeSig": "\"score\":\"(7|8|9)\"",
"negativeFlags": 5,
"positiveSig": "\"score\":\"(1|2|3)\"",
"positiveFlags": 5,
"categorySig": "",
"categoryFlags": 5
},
{
"type": "FilterSpamResult"
},
{
"type": "ImportToSpamDB",
"importReason": "Manually"
}
],
"enabled": true
}