On Feb 7, 7:02=A0pm, jOhn <net... / gmail.com> wrote:
> [Note: =A0parts of this message were removed to make it a legal post.]
>
> Here is an idea and tell me if it could be accomplished by some other mean=
s.
>
> To parse a logic statement like this:
>
> fn:function3(fn:function2(fn:function1(xargs)))
>
> Using a regex sorta like so to grep the function-start-pattern(s) :
>
> /\A((fn\:[\w\-]+)[ ]*\([ ]*)+\z/i
>
> It would be nice to ensure the proper count of ')', without confusion if s=
ay
> the xargs had ')' literal or escaped string value(s) in there.
>
> One way is to provide a count ref for function-start-pattern, so I could
> then group a pattern for match on post-xargs ')' and force the {min,max}
> count by some backref to count-of-(function-start-pattern) =3DX and put th=
at
> in there for the (function-end-pattern)+{X,X}.
>
> Then it might be something like this (ignore the lack of a match on possib=
le
> xargs for now) :
>
> /\A((fn\:[\w\-]+)[ ]*\([ ]*)+[ ]*(\)){$#1,$#1}\z/i
>
> Where $#1 would be the count ref of the first group etc. Then there would =
be
> matching count-left-side-( and count-right-side-).
>
> Or I don't understand enuf about the internals of regex to know that this =
is
> impossible.
>
> -ntcm

Could you use the awk statement  to further parse here?