[GRASS5] Draft GRASS 5.1 documentation available now
Glynn Clements
glynn.clements at virgin.net
Mon Oct 21 04:39:44 EDT 2002
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_]*
> 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
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list