Lasso Soft Inc. > Home


AuthorBrad Lindsay
LicensePublic Domain
Posted06 Aug 2012
Updated06 Aug 2012
More by this author...


The [regexp->forEachMatch] method allows you to iterate over each match in your regular expression to do complex replacements. It also automatically calls the [regexp->appendTail] at the end that is easy to forget.

Sample Usage

local(matcher) = regexp(-find=`(?i)[aeiou]`, -input='Whoa, this is heavy!')
#matcher->forEachMatch => {
// Outputs: WhOA, thIs Is hEAvy!

local(no_vowels) = regexp(-find=`(?i)[aeiou]`, -input='Lager, sir, is regal')->forEachMatch => {
// #no_vowels no the following string: 'L_g_r, s_r, _s r_g_l'

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define regexp->forEachMatch => {
    while(.find) => { givenBlock(self) } 


No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



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