CharacterArray.st
changeset 24481 c70408eab4ad
parent 24411 96a7c2830fad
child 24488 52f12f6fc206
--- a/CharacterArray.st	Sun Jul 28 01:00:14 2019 +0200
+++ b/CharacterArray.st	Sun Jul 28 05:07:49 2019 +0200
@@ -1135,7 +1135,6 @@
     "
 ! !
 
-
 !CharacterArray methodsFor:'Compatibility-ANSI'!
 
 addLineDelimiters
@@ -5547,6 +5546,26 @@
     "Modified (comment): / 02-03-2019 / 12:21:07 / Claus Gittinger"
 !
 
+findMatchString:matchString caseSensitive:caseSensitive
+    "like findString/indexOfSubCollection, but allowing GLOB match patterns.
+     find matchstring; if found, return the index, if not, return 0.
+     This is a case sensitive match: lower/uppercase are considered different.
+
+     NOTICE: match-meta character interpretation is like in unix-matching,
+             NOT the ST-80 meaning.
+     NOTICE: this GLOB, which is different from regex matching (see matchesRegex:)
+     NOTICE: the argument is the match pattern"
+
+    ^ self findMatchString:matchString startingAt:1 caseSensitive:caseSensitive ifAbsent:0
+
+    "
+      1234567890123
+     'hello world bla foo baz' findMatchString:'b* '
+    "
+
+    "Modified (comment): / 02-03-2019 / 12:21:07 / Claus Gittinger"
+!
+
 findMatchString:matchString startingAt:index
     "like findString, but allowing GLOB match patterns.
      find matchstring, starting at index; if found, return the index, if not, return 0.