Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8273 closed defect (fixed)

[PATCH] [] couldn't be escaped for mapcss regexp

Reported by: ij Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: mapcss Cc:

Description

I tried to match some regexp patterns with [ and ] as literals but couldn't figure out how that is supposed to be done. It turns out that MapCSS parser grammar reject \[ and \] escapes which would be needed for the regexp engine (in fact, most of the other escapes wouldn't work any better).

This patch only adds \[ and \] to the grammar, but perhaps somebody wants to rethink the grammar to allow other escapes too.

Attachments (1)

0001-Allow-escapes-and-work-with-MapCSS-parser.patch (1.3 KB ) - added by ij 12 years ago.
[PATCH 1/1] Allow escapes \[ and \] work with MapCSS parser

Download all attachments as: .zip

Change History (3)

by ij, 12 years ago

[PATCH 1/1] Allow escapes \[ and \] work with MapCSS parser

comment:1 by bastiK, 12 years ago

Resolution: fixed
Status: newclosed

In 5620/josm:

applied #8273 - couldn't be escaped for mapcss regexp (patch by ij)

in reply to:  description comment:2 by bastiK, 12 years ago

Replying to ij:

I tried to match some regexp patterns with [ and ] as literals but couldn't figure out how that is supposed to be done. It turns out that MapCSS parser grammar reject \[ and \] escapes which would be needed for the regexp engine (in fact, most of the other escapes wouldn't work any better).

This patch only adds \[ and \] to the grammar, but perhaps somebody wants to rethink the grammar to allow other escapes too.

I agree, but you can usually work around that with character classes, e.g. [+].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.