Re: RegEx for Function Declarations
Frans Bouma <[email protected]> Wed, 30 Jan 2008 12:35:41 +0100
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <009301c86334$3e71be30$bb553a90$@nl> |
> Thanks Ryan, that should help, even with just \w+ for a field name for now.
> One more though, how would I capture the field name?
>
> sum|max|min)\((?(fieldName)\w+)\)|(count)\(\)) ??
>
> Then how to access that field name?
it's in the matched group. Check the grouping feature in the match
class
FB
>
>
> > How about something like
> >
> > ((sum|max|min)\((\w+)\)|(count)\(\))
> >
> > you may want to alter \w+ into something that matches your field names
> > better.
> >
> > // Ryan
> >
> > On Jan 30, 2008 9:45 AM, Brady Kelly <[email protected]> wrote:
> > > I'd like to parse aggregate function declarations, as in Sum('x'),
> > where x
> > > is a field name. I'd love to break out a regex explorer and
> > experiment, but
> > > I have a demo in three hours and would appreciate some assistance.
> > The set
> > > of functions is finite, i.e. Count(), Sum(x), Max(x), Min(x).
>
> ===================================
> This list is hosted by DevelopMentor. http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com