#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Thu, 02 May 2019 17:39:22 +0200
changeset 4939 0d3a5e4dd07f
parent 4938 48be5b40e700
child 4940 d5d7391bc875
#DOCUMENTATION by cg class: StringUtilities class comment/format in: #stringMatchFunctionFor:glob:regex:caseSensitive:
StringUtilities.st
--- a/StringUtilities.st	Thu May 02 17:35:13 2019 +0200
+++ b/StringUtilities.st	Thu May 02 17:39:22 2019 +0200
@@ -321,10 +321,11 @@
 !StringUtilities class methodsFor:'matching'!
 
 stringMatchFunctionFor:aMultiPattern glob:searchForGlobPattern regex:searchForRegexPattern caseSensitive:searchIsCaseSensitive
-    "generates a check function which - given a string - checks for a match;
-     The match may contain multiple patterns, separated by
-     ';' (for and-search) or '|' (for or-search).
-     If the pattern is invalid, nil is returned and an Information-notification
+    "generates a check function which - given a string - checks for a match.
+     The match-pattern argument aMultiPattern
+     may contain multiple patterns, 
+     separated by ';' (for and-search) or '|' (for or-search).
+     If the pattern is invalid, nil is returned and an information-notification
      is signalled"
 
     |combinator stringToSearchFor stringsToSearchFor checkFunction|
@@ -453,7 +454,10 @@
      fn value:'   aa   '.
      fn value:'   bbb   '.
      fn value:'  aa bb   '.
-     
+    "
+    
+    "
+     |fn|
      fn := self stringMatchFunctionFor:'aaa;bbb' glob:false regex:false caseSensitive:false.
      fn value:'   aaa   '.
      fn value:'   aa   '.
@@ -461,8 +465,18 @@
      fn value:'  aa bb   '.
      fn value:'  aaa bb   '.
      fn value:'  aaa bbb   '.
+    "
 
     "
+     |fn|
+     fn := self stringMatchFunctionFor:'aa*;bb*' glob:true regex:false caseSensitive:false.
+     fn value:'   aaa   '.
+     fn value:'   aa   '.
+     fn value:'   bbb   '.
+     fn value:'  aa bb   '.
+     fn value:'  aaa bb   '.
+     fn value:'  aaa bbb   '.
+    "
 
     "Created: / 02-05-2019 / 17:32:12 / Claus Gittinger"
 ! !
@@ -477,5 +491,9 @@
 
 version
     ^ '$Header$'
+!
+
+version_CVS
+    ^ '$Header$'
 ! !