User Tools

Site Tools


transformations:regexp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

transformations:regexp [2018/08/15 18:59] (current)
dmitry created
Line 1: Line 1:
 +===== Regular expression =====
 +
 +This action creates a column with values that match a pattern specified using a [[https://​en.wikipedia.org/​wiki/​Regular_expression|regular expression]].
 +
 +**Modes**
 +
 +  *//First match only// - for each value find only it's first match (if any). Ignore other matches.
 +  *//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===
 +
 +Table: Before
 +^Phone number ^
 +| 1234567890 ​   |
 +| (123)456-7890 |
 +| 123-4567890 ​  |
 +| 123-456-7890 ​ |
 +| (123)4567890 ​ |
 +
 +Goal: find phone numbers that match pattern ''​(XXX)XXX-XXXX''​ where X is any number.
 +Solution: Use regular expression ''​^\(\d{3}\)\d{3}-\d{4}''​. If not matched make empty.
 +
 +Table: After
 +^Phone number ​  ^ Matches ​ ^
 +| 1234567890 ​   |  |
 +| (123)456-7890 |(123)456-7890 |
 +| 123-4567890 ​  ​| ​ |
 +| 123-456-7890 ​ |  |
 +| (123)4567890 ​ |  |
  
transformations/regexp.txt · Last modified: 2018/08/15 18:59 by dmitry