In Entuity, attributes values in which you can free type also allow entry of regular expressions (Regex). When defining filter rules with regular expression, note that pattern matching is case-sensitive.
Recommendations:
- It is expensive to use capturing groups.
(<text-to-match) is a capturing group, (?:<text-to-match) is a non-capturing group. - Case insensitive matches should be avoided - these are expensive due to the need to support multiple character sets.
Therefore, do not use (?i) or /i unless it is unavoidable (and if so, use it for the smallest part of the search).
Examples:
- a name that includes lon:
lon
- a name that starts with lon:
^lon
- a name that starts with either lon or par:
/^(?:(?:lon)|(?:par))
- a name that ends in 1:
1$
- a name that ends in a, b or c:
[abc]$
- a name that contains at least one digit:
[0-9]
- a name that include s, t, u or v:
[!s-v]
- a name that include a pair of digits next to each other:
[0-9]{2}
- a name that has x as the fourth character:
^…x
- 1 or more special characters (metacharacters) in their name require that the character is escaped. For example, a name with a plus sign is escaped using the backslash:
eol\+us
Comments
0 comments
Please sign in to leave a comment.