[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] String editing?
From: |
Werner LEMBERG |
Subject: |
RE: [Groff] String editing? |
Date: |
Fri, 11 Feb 2000 08:31:12 GMT |
> Sure there *are* string editing functions in groff:
> .substring str \n[start] \n[end] \" groff only
> .as ...... \" both troff and groff
>
> Consider following test:
> .ds str <this
> .tm [\*[str]]
> .ds sstr \*[str]
> .substring sstr 2
> .tm [\*[sstr]]
> .ds sstr \*[str]
> .substring sstr 2 3
> .tm [\*[sstr]]
>
> this outputs following on STDERR:
> [<this]
> [this]
> [t]
Of course completely undocumented... I'll add some docs to troff.man
and groff.texinfo.
I will also soon include a `length' macro which computes the length of
a string.
> Not as powerful as Perl string editing functions are, but .... I am
> thinking about merging Perl and Groff together to get really
> powerful string manipulation in groff, even search/replace regexes
> will be made easily in this case. Is anyone intresting on this, or
> I am alone on this? Should I really do this work? (I tested Perl
> and groff coexistence, first tests were Ok, but I'm not sure it is
> really useful)
What do you mean with `merging'? Adding Perl's string functions to
groff? This is a good thing, I think -- the only question is to which
extent...
Or do you mean writing a macro package to access Perl's string
manipulation functions from within groff? This is also very nice, but
somewhat limited since you have to use groff's `-U' switch.
Werner