The question is like this:
My Regex is constructed with several parts, I want to match a ordered combination of one or more patterns.
E.g. If I have three parts, patternA
, patternB
, patternC
, I want to match patternA, patternB, patternC, patternApatternB, patternBpatternC, patternApatternBpatternC
. I tried to use (patternA)?(patternB)?(patternC)?
, but it suffers from matching empty string.
So the question is how to exclude the matches of empty string or is there any equivalent method that can satisfy the need?
Any suggestion is highly appreciated. Thanks a lot in advance!