--- a/CharacterArray.st Sun Jan 01 19:22:26 2006 +0100
+++ b/CharacterArray.st Mon Jan 09 09:44:38 2006 +0100
@@ -3233,6 +3233,29 @@
"
!
+includesMatchString:matchString caseSensitive:caseSensitive
+ "like includesString, but allowing match patterns.
+ find matchstring; if found, return true, otherwise return false"
+
+ ^ (self findMatchString:matchString startingAt:1 ignoreCase:caseSensitive not ifAbsent:0) ~~ 0
+
+ "
+ 'hello world' includesMatchString:'h*' caseSensitive:true
+ 'hello world' includesMatchString:'h*' caseSensitive:false
+ 'Hello world' includesMatchString:'h*' caseSensitive:true
+ 'Hello world' includesMatchString:'h*' caseSensitive:false
+
+ 'hello world' includesMatchString:'h[aeiou]llo' caseSensitive:true
+ 'hello world' includesMatchString:'h[aeiou]llo' caseSensitive:false
+
+ 'hello world' includesMatchString:'wor*' caseSensitive:true
+ 'hello world' includesMatchString:'wor*' caseSensitive:false
+
+ 'hello world' includesMatchString:'woR*' caseSensitive:true
+ 'hello world' includesMatchString:'woR*' caseSensitive:false
+ "
+!
+
match:aString
"return true if aString matches self, where self may contain meta-match
characters $* (to match any string) or $# (to match any character).
@@ -5033,7 +5056,7 @@
!CharacterArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.328 2005-12-22 15:01:42 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.329 2006-01-09 08:44:38 cg Exp $'
! !
CharacterArray initialize!