[PATCH] Make ISO-6709 coordinate regex less restrictive

José Carlos Andreu Galán joscandreu at gmail.com
Tue May 27 11:42:11 PDT 2014


Got it edited.
Now only two extra group are being added (1 for lat and 1 for lon).
Maybe the grouping ([\'\\s]|\'\\s*) could be avoided, but if it's possible
I don't know how to do it.

Regards,
Jose



2014-05-27 0:22 GMT+02:00 Dirk Hohndel <dirk at hohndel.org>:

> On Tue, May 27, 2014 at 12:03:15AM +0200, José Carlos Andreu Galán wrote:
> > -             regExp = QString("(\\d+)[" UTF8_DEGREE
> "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([NS%1%2])"
> > -                              "\\s*(\\d+)[" UTF8_DEGREE
> "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([EW%3%4])")
> > +             regExp = QString("(\\d+)[" UTF8_DEGREE
> "\\s]\\s*(\\d+)([\'\\s]|\'\\s*)(\\d+)([,\\.]"
>
> same issue, just moved down the line...
>
> ([\'\\s]|\'\\s*) is overkill
>
> * allows zero or more
> so simply do
>
> [\'\\s]\\s*
>
> that saves you the group and makes the regex easier to read
>
> /D
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140527/2f08b883/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-ISO6709-coordinate-regex-less-restrictive.patch
Type: text/x-patch
Size: 2470 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140527/2f08b883/attachment.bin>


More information about the subsurface mailing list