The pattern is interpreted as a set of individual characters that can be matched in any order and in any combination. You set the iterator to perform either inclusive or exclusive matching.
When you create this iterator, you must specify an ESpanType value indicating whether the matching should be inclusive or exclusive. TSpanTextPatternIterator provides no default behavior.
For example, this code tokenizes text by locating ranges of text bounded by the space character:
TStandardText spanText(" "); TSpanTextPatternIterator iterator(&searchText, spanText, TSpanTextPatternIterator::kExclusive); TTextRange wordRange; for (TTextOffset wordOffset = iterator.First(wordRange); wordOffset != TTextPatternIterator::kNotFoundOffset; wordOffset = iterator.Next(wordRange)) { // Do something interesting... }