[geos-devel] GEOS 3.7.0rc1 release

Sebastiaan Couwenberg sebastic at xs4all.nl
Mon Aug 20 23:22:30 PDT 2018


On 8/21/18 1:25 AM, Greg Troxel wrote:
> 
> "Regina Obe" <lr at pcorp.us> writes:
> 
>> I asked Sebastian the same thing.  He said it's needed in configure
>> script to escape the [] as I recall.
> 
> Of course :-) I was looking back and forth in so many rules I forgot
> which it was.
> 
> But, I figured out what was wrong.  This is the version from configure
> (so no extra [ - don't paste it in...).    The key thing is to add ()
> around .* before the ?, because
> 
>   .*?
> 
> is malformed.   It's the .* production that the ? applies to (present or
> not).
> 
>   VERSION_RELEASE=`echo "$VERSION" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+)(.*)?$/\1/'`
> 
> GNU sed may be allowing this as an extension, because "*?" doesn't make
> sense, since * is repetition.

Note the -E option for extended regular expressions which came from GNU
sed but is now included in POSIX.

The ? should make the .* expression non-greedy.

> Actually, the whole ? is redundant and can be just dropped, because
> 
>   (.*)?
> 
> matches zero or more occurrences fo any character, and also the empty
> string.  But .* matches the empty string anyway.  So while I can see the
> point that it leads the reader to think "either some arbitrary string or
> the empty string", it's just more complicated for no good reason.
> 
> So just drop the ? after the .*

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20180821/6b4652c0/attachment.sig>


More information about the geos-devel mailing list