Lasso Soft Inc. > Home

[ string->forEachMatch ]

Method

[string->forEachMatch] permits each regular expression match to be accessed in a forEach method.

  • Syntax
'String Value'->forEachMatch(Regular Expression) => {
	doSomethingWithMatch(#1)
}
Examples
  • Beginner

To access each regular expression match from a string:

Use the [string->forEachMatch] method. The following example takes the regular expression matches from a string, converts each to uppercase, then auto-collects the output using carets {^ ... ^}.

Code

'Resistance is futile.'->forEachMatch(regexp('(?i)t..')) => {^
	string_uppercase(#1)
^}

Result

TANTIL

Recent Comments

No Comments found

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. > Home

 

 

©LassoSoft Inc 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft