List Parsing Regular Expression



Say I have a string which is of the format

{A, B, C, D}

for some variable number of objects. I want a regular expression that
will put each of A, B, C, and D into its own separate capture group
without any commas. If the string is

{}

then the only capture by the regular expression should be the zeroth
capture, or the whole string.

I've tried some various things, but I keep coming up short and it's
capturing things I don't expect.

Any gurus out there who can offer a suggestion?

Thanks
Zach

.



Relevant Pages

  • Re: Regular Expression Hangs
    ... You wouldn't need a regular expression to match ... a single fixed string. ... Those patterns are defined by rules that are expressed in the ... will capture the following: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Looking for help with Regular Expression
    ... capture a string of text that falls between an opening squre bracket ... The end of my string sometimes contains a cross ... But my regular expression is stopping after the first "]" so after I ... I'm not sure how to make my capture more greedy so I've resorted to ...
    (comp.lang.python)
  • Looking for help with Regular Expression
    ... capture a string of text that falls between an opening squre bracket ... The end of my string sometimes contains a cross ... But my regular expression is stopping after the first "]" so after I ... I'm not sure how to make my capture more greedy so I've resorted to ...
    (comp.lang.python)
  • Re: String Formatting in VB.NET
    ... Since you want to ensure that the format is correct, ... to use a Regular Expression. ... from string in the hopes of adding my own formatting to the string ... Kevin Spencer wrote: ...
    (microsoft.public.dotnet.general)
  • Re: Length of longest contiguous digits exercise
    ... this contiguous block of 1s is remembered ... string must not appear at any other point in the string. ... this is undefined when there is no capture ... (which happens when there are no digits in the ...
    (comp.lang.javascript)

Loading