CharacterArray.st
changeset 23459 98958ccb01fb
parent 23428 9a1a7a4b8bfb
child 23548 28f31f30a404
equal deleted inserted replaced
23458:4f874be4beb2 23459:98958ccb01fb
  5627     "
  5627     "
  5628     (PreviousMatches isNil
  5628     (PreviousMatches isNil
  5629     or:[(matchScanArray := PreviousMatches at: self ifAbsent:[nil]) isNil]) ifTrue:[
  5629     or:[(matchScanArray := PreviousMatches at: self ifAbsent:[nil]) isNil]) ifTrue:[
  5630         matchScanArray := self class matchScanArrayFrom:self escapeCharacter:escape.
  5630         matchScanArray := self class matchScanArrayFrom:self escapeCharacter:escape.
  5631         matchScanArray isNil ifTrue:[
  5631         matchScanArray isNil ifTrue:[
  5632             'CharacterArray [info]: invalid matchpattern:''' infoPrint. self infoPrint. ''' comparing for equality.' infoPrintCR.
  5632             ParseWarning raiseRequestErrorString:('CharacterArray [info]: invalid matchpattern: ''%1'' comparing for equality' bindWith:self).
  5633             ^ self = aString
  5633             ^ self = aString
  5634 "/            ^ false
  5634             "/ ^ false
  5635         ].
  5635         ].
  5636         PreviousMatches isNil ifTrue:[
  5636         PreviousMatches isNil ifTrue:[
  5637             PreviousMatches := CacheDictionary new:15
  5637             PreviousMatches := CacheDictionary new:15
  5638         ].
  5638         ].
  5639         PreviousMatches at:self put:matchScanArray.
  5639         PreviousMatches at:self put:matchScanArray.
  5647         caseSensitive:caseSensitive
  5647         caseSensitive:caseSensitive
  5648 
  5648 
  5649     "
  5649     "
  5650      '*ute*' match:'12345COMPUTER' from:1 to:5 caseSensitive:false
  5650      '*ute*' match:'12345COMPUTER' from:1 to:5 caseSensitive:false
  5651      '*ute*' match:'12345COMPUTER' from:6 to:13 caseSensitive:false
  5651      '*ute*' match:'12345COMPUTER' from:6 to:13 caseSensitive:false
       
  5652      
       
  5653      '*[12' match:'12345COMPUTER' from:6 to:13 caseSensitive:false -- gives a warning
  5652     "
  5654     "
  5653 
  5655 
  5654     "Modified: / 29-07-2017 / 14:01:42 / cg"
  5656     "Modified: / 29-07-2017 / 14:01:42 / cg"
       
  5657     "Modified (comment): / 24-10-2018 / 09:01:31 / Claus Gittinger"
  5655 !
  5658 !
  5656 
  5659 
  5657 match:aString from:start to:stop ignoreCase:ignoreCase
  5660 match:aString from:start to:stop ignoreCase:ignoreCase
  5658     <resource: #obsolete>
  5661     <resource: #obsolete>
  5659     "return true if part of aString matches myself,
  5662     "return true if part of aString matches myself,