[GRASS5] Draft GRASS 5.1 documentation available now
Markus Neteler
neteler at itc.it
Mon Oct 21 05:41:30 EDT 2002
On Mon, Oct 21, 2002 at 09:39:44AM +0100, Glynn Clements wrote:
>
> Markus Neteler wrote:
>
> > To improve the function detection, I need some regex assistance for
> > 'sed' (compare
> > grass51/lib/vector/Vlib/generate_dox.sh
> > ). In general I grep all '\\fn' from all *.c files, then I want
> > to extract the function names:
> > So, how can I extract words starting with 'Vect_' and ending with either
> > space or '('?
>
> It's normally better to specify which characters *are* part of the
> name rather than those which aren't. E.g.
>
> Vect_[a-zA-Z0-9_]*
that's of course better.
> > The current solution in above script is not error free.
> > Examples:
> >
> > \fn int Vect_tin_get_z( struct Map_info *Map
> > -> Vect_tin_get_z
> > or
> > \fn struct line_cats *Vect_new_cats_struct ()
> > -> Vect_new_cats_struct
> >
> > etc. Unfortunately I don't know REGEX enough to write a 'sed' instruction.
>
> Try e.g.:
>
> /^ *\\fn .*\(Vect_[a-zA-Z0-9_]*\).*$/s//\1/p
Works perfectly. I have submitted to CVS.
Thanks,
Markus
More information about the grass-dev
mailing list