#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)
Change History (3)
by , 12 years ago
Attachment: | 0001-Allow-escapes-and-work-with-MapCSS-parser.patch added |
---|
comment:2 by , 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. [+]
.
[PATCH 1/1] Allow escapes \[ and \] work with MapCSS parser