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 counting, so you have add something else (either code, or another program if you use something like egrep). /Allan