You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
Ever wanted to add a field that does not exist in our out-of-the-box models and you thought: We don’t need a smart model to
FAQ
How can I only look in the email-header for my regex?
By adding the option where_to_search to your rule. An example field would look like this:
"field_to_detect": {
"type": "tag
"rules": [
{
"confidence": 97,
"+rule": ["REG:subject_to_match"]
"where_to_search":
{
"search_in": ["email_subject"]
}
}
]
}
How can I test if my regex has the right format?
In the front-end you can go to a certain page and select the text view (see attached image). This way you can copy the text you are searching in. On this site you can test the regex you created: https://regex101.com/. PS: Don’t forget to set the language to python on the left hand side of the screen.