Regular expression: Difference between revisions
From Planfix
No edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
|description=Using regular expressions in Planfix | |description=Using regular expressions in Planfix | ||
}} | }} | ||
Regular expressions in [[Rules for creating tasks by email | rules for processing emails]] allow you to isolate a desired fragment of text when [[Email rules: Extracting data | extracting data]] from an email. | '''Regular expressions''' in [[Rules for creating tasks by email | rules for processing emails]] allow you to isolate a desired fragment of text when [[Email rules: Extracting data | extracting data]] from an email. | ||
== Important == | == Important == | ||
*The use of regular expressions typically requires '''programming skills'''. If you don't know any programming languages, you should ask for help. | *The use of regular expressions typically requires '''programming skills'''. If you don't know any programming languages, you should ask for help. | ||
*In Planfix, regular expressions operate with the Pattern.DOTALL and Pattern.MULTILINE options. For validation, you can use the [https://regex101.com/online validator] — [https://p.pfx.so/pf/nG/2iUOoF.png gms] | *In Planfix, regular expressions operate with the Pattern.DOTALL and Pattern.MULTILINE options. For validation, you can use the [https://regex101.com/online validator] — [https://p.pfx.so/pf/nG/2iUOoF.png gms] | ||
*Regular expressions can also be used with the [[REGEXPFIND Function]]. | *Regular expressions can also be used with the [[REGEXPFIND Function]]. | ||
== Formatting regular expressions == | == Formatting regular expressions == | ||
Planfix uses the regular expression format used in Java. The syntax of regular expressions uses the symbols <([{\^-=$!|]})?*+.>, which can be combined with letters to create metacharacters. The most frequently used metacharacters are listed in this table: | Planfix uses the regular expression format used in Java. The syntax of regular expressions uses the symbols <([{\^-=$!|]})?*+.>, which can be combined with letters to create metacharacters. The most frequently used metacharacters are listed in this table: | ||
Line 66: | Line 65: | ||
|- | |- | ||
|} | |} | ||
== Helpful information == | == Helpful information == | ||
*The result of text processing using a regular expression becomes the first capturing group. Accordingly, what is needed in the result should be enclosed in parentheses, and the rest of the groups should be made non-capturing (?:) | *The result of text processing using a regular expression becomes the first capturing group. Accordingly, what is needed in the result should be enclosed in parentheses, and the rest of the groups should be made non-capturing '''(?:)''' | ||
Line 80: | Line 73: | ||
*[[Creating and editing rules]] | *[[Creating and editing rules]] | ||
*[[Rules for creating tasks by email]] | *[[Rules for creating tasks by email]] | ||
Latest revision as of 08:20, 28 October 2024
Regular expressions in rules for processing emails allow you to isolate a desired fragment of text when extracting data from an email.
Important
- The use of regular expressions typically requires programming skills. If you don't know any programming languages, you should ask for help.
- In Planfix, regular expressions operate with the Pattern.DOTALL and Pattern.MULTILINE options. For validation, you can use the validator — gms
- Regular expressions can also be used with the REGEXPFIND Function.
Formatting regular expressions
Planfix uses the regular expression format used in Java. The syntax of regular expressions uses the symbols <([{\^-=$!|]})?*+.>, which can be combined with letters to create metacharacters. The most frequently used metacharacters are listed in this table:
Metacharacter | Meaning |
---|---|
^ | beginning of input |
$ | end of input |
\d | digit |
\D | non-digit character |
\s | space character |
\S | non-space character |
\w | alphanumeric character or underscore |
\W | any character except alphanumerics and underscores |
. | any character |
\t | tab character |
\n | newline symbol |
\r | carriage return symbol |
[abc] | any of the characters listed (a, b, or c) |
[^abc] | any character except those listed (not a, b, or c) |
[a-zA-Z] | multiple ranges (Latin characters from A to Z, case-insensitive) |
[a-d[m-p]] | combining characters (from a to d and from m to p) |
[a-z&&[def]] | overlapping characters (d, e, f) |
[a-z&&[^bc]] | subtracting characters (a, d-z) |
? | one or not exist |
* | match zero or one |
+ | one or more times |
{n} | n times |
{n,} | n or more times |
{n,m} | at least n times and no more than m times |
Helpful information
- The result of text processing using a regular expression becomes the first capturing group. Accordingly, what is needed in the result should be enclosed in parentheses, and the rest of the groups should be made non-capturing (?:)