transformations:regexp
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
transformations:regexp [2018/08/15 14:59] – created dmitry | transformations:regexp [2021/07/19 02:22] (current) – [Examples] craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Regular expression | + | {{ transformations: |
+ | ======REGULAR EXPRESSION====== | ||
+ | Category: Transform / Advanced \\ | ||
- | This action creates a column with values that match a pattern specified using a [[https:// | + | \\ |
+ | =====Description===== | ||
+ | This action creates a column with values that match a pattern specified using a [[https:// | ||
- | **Modes** | + | \\ |
+ | =====Use cases===== | ||
+ | A Regular Expression (" | ||
- | *//First match only// - for each value find only it's first match (if any). Ignore other matches. | + | Confirm |
- | *//All matches// - for each value find all possible matches. If there is more than 1 match then insert additional row(s) into the resulting dataset. | + | |
- | ===Example=== | + | Validate that values fall within specific formatting parameters, e.g., a specific number of letters, numbers, and symbols in a required order. |
- | Table: Before | + | Check for alternate spellings of keywords, e.g., " |
+ | |||
+ | RegEx can be used to replace a pattern of characters with another value or pattern.\\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |Source column|Select the column to evaluate the values in.| | ||
+ | |Regular expression< | ||
+ | |Case insensitive|When checked, text case is not taken into account when evaluating matches. | ||
+ | |New column name|Enter the name of the new column that will hold the match results. | ||
+ | |Mode|Select whether to return the first match only, or all matches. | ||
+ | |If not matched|Select what value is returned when a match is not made. Options: // | ||
+ | \\ | ||
+ | ====Mode options==== | ||
+ | ^Option | ||
+ | |First match only|Only the first match to the pattern will be returned. | | ||
+ | |All matches (may create new lines)|All matches found will be returned. | ||
+ | |Capture mode |This option appears when //All matches// (above) is selected. | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | |||
+ | EasyMorph uses the [[https:// | ||
+ | |||
+ | While most " | ||
+ | |||
+ | RegEx can be set to detect one or more occurrences of the search pattern within a given value.\\ | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | **Example: | ||
+ | |||
+ | **Source table:** | ||
^Phone number ^ | ^Phone number ^ | ||
| 1234567890 | | 1234567890 | ||
Line 17: | Line 56: | ||
| 123-456-7890 | | 123-456-7890 | ||
| (123)4567890 | | (123)4567890 | ||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > Source column is "Phone number" | ||
+ | > Regular expression is '' | ||
+ | > New column name is " | ||
+ | > Mode is "First match only" | ||
+ | > If not matched "Make empty" | ||
- | Goal: find phone numbers that match pattern '' | ||
- | Solution: Use regular expression '' | ||
- | Table: After | + | \\ |
+ | **Result table:** | ||
^Phone number | ^Phone number | ||
| 1234567890 | | 1234567890 | ||
Line 28: | Line 73: | ||
| 123-456-7890 | | 123-456-7890 | ||
| (123)4567890 | | (123)4567890 | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | |||
+ | * [[transformations: | ||
+ | * [[syntax: | ||
+ | * [[syntax: | ||
+ | * [[syntax: | ||
+ | |||
+ | |||
transformations/regexp.txt · Last modified: 2021/07/19 02:22 by craigt