Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread galyle
On Oct 10, 4:59 pm, Vlastimil Brom wrote: > 2011/10/10 galyle : > > > > > > > > > > > HI, I've looked through this forum, but I haven't been able to find a > > resolution to the problem I'm having (maybe I didn't look hard enough > > -- I have to believe this has come up before).  The problem is t

Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread Ian Kelly
On Mon, Oct 10, 2011 at 4:49 PM, MRAB wrote: > Instead of "\S" I'd recommend using "[^\]]", or using a lazy repetition > "\S+?". Preferably the former. The core problem is that the regex matches ambiguously on the problem string. Lazy repetition doesn't remove that ambiguity; it merely attempts

Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread Vlastimil Brom
2011/10/10 galyle : > HI, I've looked through this forum, but I haven't been able to find a > resolution to the problem I'm having (maybe I didn't look hard enough > -- I have to believe this has come up before).  The problem is this: > I have a file which has 0, 2, or 3 groups that I'd like to rec

Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread MRAB
On 10/10/2011 22:57, galyle wrote: HI, I've looked through this forum, but I haven't been able to find a resolution to the problem I'm having (maybe I didn't look hard enough -- I have to believe this has come up before). The problem is this: I have a file which has 0, 2, or 3 groups that I'd li

Question: Optional Regular Expression Grouping

2011-10-10 Thread galyle
HI, I've looked through this forum, but I haven't been able to find a resolution to the problem I'm having (maybe I didn't look hard enough -- I have to believe this has come up before). The problem is this: I have a file which has 0, 2, or 3 groups that I'd like to record; however, in the case of