[RegExp->Split] is a utility tag which splits the input string at every instance of the find pattern and returns the resulting array. The tag accepts optional parameters to override the -Find or -Input with new values.
For example, the find pattern [aeiou] will split the word "fox" into an array of two elements [Array: 'f', 'x']. If the find pattern contains groups then those groups will also be inserted into the output array. For example, the find pattern ([aeiou]) where the parentheses define a group will split the word "fox" into an array with three elements [Array: 'f', 'o', 'x'] since the group containing the vowel "o" is inserted into the output.
Note - The same result of this tag can also be returned by passing the regular expression object to [String->Split] tag. [(RegExp: -Find='[aeiou]')->(Split: 'fox')] is equivalent to ['fox'->(Split: (RegExp: -Find='[aeiou]')]
[Var: 'myRegExp' = (RegExp: '\\W+')]
[$myRegexp->(Split: 'the lazy dog')]
See the Lasso 8 Language Guide for examples of how to use this tag.
Tag Link | [RegExp->Split] | Category | String |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 8.5 |
Output Type | Array | Security | None |
Implementation | Sets | Lasso 8.5 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft