Follow-up Comment #9, bug #66438 (group groff):

[comment #8 comment #8:]
> @Branden: Out of curiosity and eagerness to learn: Why do you wrap the range
> expressions into bracket expressions, like this?

To quote the brackets the shell command needs to see.
 

> [[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*


> 
> It seems a bit redundant to me, as this shorter version also matches for me
> at least:
> 

> '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'


"m4/groff.m4" is an m4 file, not shell script per se.

See
[https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Active-Characters.html
the GNU Autoconf manual's node on "Active Characters"] for more.
 
> I tried to find out myself and read through the corresponding parts in the
> POSIX standard document you linked at (thank you! I remembered seeing a
> reference to it somewhere in the groff repo...), but was not able to spot
> anything to that end.
> 
> If you'd chosen to use character class expressions, like [:digit:], the
> wraping brackets would be necessary, though...

I don't remember if POSIX character classes are valid in BREs, but setting
that aside, you're correct.  But this intsance is _still_ an Autoconf macro
definition, so then, I suspect, the brackets would have to be *tripled*.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66438>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to