Questions tagged [capturecollection]
2 questions
5
votes
1 answer
c# regex captures
I am matching a repeating group that contains a mixture of optional and non-optional groups. When I iterate over the captures, the capture collections are always collapsed, i.e. they do not insert a null element for the non matched items.
Is…

greenback
- 1,506
- 2
- 17
- 29
2
votes
3 answers
How to replace each Capture of a Group individually?
I have a regular expression which uses GroupCollections in it's capture to capture a group of Item Id's (which can be comma separated, also accounting for the final one to have the word 'and'):
(\bItem…

michael
- 14,844
- 28
- 89
- 177