Author: Knute JohnsonKnute Johnson Date: Jul 15, 2008 20:18
Daniel Pitts wrote:
> Knute Johnson wrote:
>> Is there a way to get multiple capturing groups without having
>> multiple sets of parenthesis?
>>
>> "ABCDEFGHIJKL"
>>
>> Regex "(\\w{3})" will match 3 letters
>>
>> "(\\w{3}){4}" will match all four sets of three letters but there will
>> be only one capturing group.
>>
>> Is there a way to get multiple capturing groups without doing
>> "(\\w{3})(\\w{3})(\\w{3})(\\w{3})"?
>>
>> Thanks,
>>
> Nope. I think you're asking for too much out of regexs. :-)
>
> Although, I suspect it would be "somewhat trivial" to add a groupList() ...
|