Lasso Soft Inc. > Home

[RegExp->MatchString]

[RegExp->MatchString] returns the substring of the input matched by the last call to [RegExp->Find] during an interactive search/replace operation. This tag cannot be called until [RegExp->Find] has found a valid match of the find pattern within the input string.

By default [RegExp->MatchString] returns the entire matched substring of the input. This tag also accepts an optional integer parameter which selects a group from within the match to return. The tag [RegExp->GroupCount] can be used to determine how many groups were specified in the find pattern.

  • Syntax
  • Parameters
[Var: 'myRegExp' = (RegExp: -Find='(\\w)(\\w+)')]
[$myRegexp->(Input: 'the lazy dog')]
[While: $myRegExp->Find]
  [Var: 'myReplacement' = (String_Uppercase: $MyRegExp->(MatchString: 1))]
  [$myRegExp->(AppendReplacement: $myReplacement)]
  [$myRegExp->(AppendReplacement: $MyRegExp->(MatchString: 2))]
[/While]
[$myRegExp->AppendTail]
[$myRegExp->Output]
Optional Parameters
Group The integer group whose substring should be returned. Defaults to returning the entire matched string.
Examples

See the Lasso 8 Language Guide for examples of how to use this tag.

Tag Link [RegExp->MatchString] Category String
Type Member Data Source Any
Support Preferred Version 8.5
Output Type None 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. > Home

 

 

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