...
For option 2, 3 and 4 we use the method of a Python Slice. They require a specified start and stop value to be defined. Start and stop can be integers, to define an index, or floats to define a percentage of a slice. Start and stop need to have the same type.
Code Block |
---|
[start, stop] # items from start through stop-1 [-start:-stop] # items from start (counting from end) through stop-1 (counting from end) [start] # items from start through end (only allowed for the last slice) [-start] # items from start (counting from end) through end (only allowed for the last slice) |
Eg. Example 1: Imagine that in our example we only want to look in the first 10 and last 20 10 characters of the email_from. In this case we would change our rule as follows:
Code Block | ||
---|---|---|
| ||
{ "confidence": 97, "+rule": ["L:no-reply@contract.fit"], "where_to_search": { "search_in": ["email_from"], "limits": { "characters": [[0,10], [-2010]] } } } |
if the email_from is the letters of the alphabet: “abcdefghijklmnopqrstuvwxyz”. We would now search in “abcdefghijqrstuvwxyz”
Example 1: Imagine that in our example we only want to look in the first 20% characters of the email_from. In this case we would change our rule as follows:
Code Block | ||
---|---|---|
| ||
{
"confidence": 97,
"+rule": ["L:no-reply@contract.fit"],
"where_to_search": {
"search_in": ["email_from"],
"limits": {
"characters": [[0., 0.2]]
}
}
} |
if the email_from is the letters of the alphabet: “abcdefghijklmnopqrstuvwxyz”. We would now search in “abcdef”
Anchor | ||||
---|---|---|---|---|
|
...