Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r079

...

Excerpt

Returns true if the leftmost set of characters of a column of values matches a pattern. The source value can be any data type, and the pattern can be a

d-s-itemlang
itempattern
, regular expression, or a string.

...

Output: Returns true if the first three letters of the FullName column value are "Mr.". 

d-s-itemlang
itempattern
 example:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:startswith(CustId,`{alpha-numeric}{6}`) as:'validateCustId'

startswith(CustId,`{alpha-numeric}{6}`)

Output: Returns true if the CustId column begins with a six-digit alpha-numeric sequence. Otherwise, the value is set to false.

Regular expression pattern exampleexpression example:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextset col:Status value:if(startswith(phone,/^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/),'phone - ok','phone - error')

if(startswith(phone,/^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/),'phone - ok','phone - error')

...

Required?Data TypeExample Value
YesColumn referencemyColumn

pattern

d-s-itemlang
itempattern
, regular expression, or string literal to locate in the values in the specified column.

...