Tagged String Output

A pair of numbers, l,c, are used to label parenthesized regular expressions according to the nesting level, l, and the count, c, at a given nesting level.  There is no theoretical limit on the number of parenthesized regular expressions or the level to which the parenthsized regular expressions may be nested.  However, while matching a regular expression, QTGrep only keeps track of tagged strings to a nesting level of 7, 1 <= l <= 7, and a maximum count of 31, 1 <= c <= 31, for each level.  QTGrep can utilize regular expressions with parenthesis nested deeper than 7 and a count greater than 31 at each level

The nesting level, l, refers to nested parenthesized expressions, i.e., expressions containing parenthesized expressions which are themselves contained within parenthesis.  Thus the following expressions contain parenthesized expressions nested to various levels as noted:

   nesting
level expression
0 a
1 a(b)c
2 a(b(c)d)e
3 a(b(c(d)e)f)g
4 a(b(c(d(e)f)g)h)i
5 a(b(c(d(e(f)g)h)i)j)k
6 a(b(c(d(e(f(g)h)i)j)k)l)m
7 a(b(c(d(e(f(g(h)i)j)k)l)m)n)o
The count, c, refers to the number of parenthesized expressions at any given nesting level.  Each of the above expressions contain a count of one expression at each nesting level.  The following expressions contain two or more counts at each nesting level as indicated by the 'level,count', 'l,c' labels:
    nesting
level expression
0 a
1 a(b)cde(f)
| |
-1,1 -1,2
2 a(b(c)de(f)g)hi(j)k
| | | |
| -2,1 -2,2 |
-1,1 -1,2
2 a(b(c)d(e)f)g(h(i)j(k)l)m
| | | | | |
| -2,1-2,2 | -2,3-2,4
-1,1 -1,2
3 a(b(c)d(e)f)g(h(i)j(k(l)m)n)o
| | | | | | |
| | | | | | -3,1
| -2,1-2,2 | -2,3-2,4
-1,1 -1,2
Note that the count is cumulative at each nesting level, even if the levels change between counts.



© Terry D. Boldt 1997-2005
All Rights Reserved
Last Updated: Feb. 03, 2005