Re: regexp q.

2008-07-17 Thread Andrew Sackville-West
On Thu, Jul 17, 2008 at 09:22:53AM -0700, Bob McGowan wrote: ... > Besides, Andrew's eyes need time to heal ;) no hope of that. I just need to finally bite the bullet and grok some more regex. The only issue with Florian's now snipped line is that its so daunting I don't know where to start. And

Re: regexp q.

2008-07-17 Thread Bob McGowan
Andrew Sackville-West wrote: On Wed, Jul 16, 2008 at 09:45:03PM +0200, Florian Kulzer wrote: ... The insane approach (dedicated to Andrew S-W, who is a great perl aficionado): #! /usr/bin/perl -w #read file open ( FH, "test.txt" ); $string = ; close ( FH ); # match and count while ( $string

Re: regexp q.

2008-07-16 Thread Andrew Sackville-West
On Wed, Jul 16, 2008 at 09:45:03PM +0200, Florian Kulzer wrote: ... > > The insane approach (dedicated to Andrew S-W, who is a great perl > aficionado): > > #! /usr/bin/perl -w > > #read file > open ( FH, "test.txt" ); > $string = ; > close ( FH ); > > # match and count > while ( $string =~ /

Re: regexp q.

2008-07-16 Thread Hugo Vanwoerkom
Florian Kulzer wrote: On Tue, Jul 15, 2008 at 15:44:02 -0500, Hugo Vanwoerkom wrote: Hi, Not being very versatile in regular expressions I wonder if is possible to express this: Find the number of ),( triplets in a string, provided they are not in a substring that is enclosed in single qu

Re: regexp q.

2008-07-16 Thread Florian Kulzer
On Tue, Jul 15, 2008 at 15:44:02 -0500, Hugo Vanwoerkom wrote: > Hi, > > Not being very versatile in regular expressions I wonder if is possible > to express this: > > Find the number of ),( triplets in a string, provided they are not in a > substring that is enclosed in single quotes, ignoring

Re: regexp q.

2008-07-15 Thread Allan Wind
On 2008-07-15T15:44:02-0500, Hugo Vanwoerkom wrote: > Find the number of ),( triplets in a string, provided they are not in a > substring that is enclosed in single quotes, ignoring the pair \' in all > cases. > > in a regular expression? Sounds like home work. You cannot use regex for countin