Previous: RegexResults-accessing, Up: RegexResults


1.141.2 RegexResults: testing

ifMatched: oneArgBlock
If the regular expression was matched, pass the receiver to oneArgBlock and return its result. Otherwise, return nil.


ifMatched: oneArgBlock ifNotMatched: zeroArgBlock
If the regular expression was matched, evaluate oneArgBlock with the receiver as the argument. If it was not, evaluate zeroArgBlock. Answer the result of the block's evaluation.


ifNotMatched: zeroArgBlock
If the regular expression was matched, return the receiver. If it was not, evaluate zeroArgBlock and return its result.


ifNotMatched: zeroArgBlock ifMatched: oneArgBlock
If the regular expression was matched, evaluate oneArgBlock with the receiver as the argument. If it was not, evaluate zeroArgBlock. Answer the result of the block's evaluation.


matched
Answer whether the regular expression was matched