Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11598 closed defect (fixed)

Cannot match literal quotation mark (?) in regular expression

Reported by: Dakon Owned by: team
Priority: normal Milestone: 15.08
Component: Core Version: tested
Keywords: mapcss Cc:

Description

I am not able to write a MapCSS rule (neither for rendering nor for validator) that matches on a literal quotation mark in the value. It looks like escaping using backslashes does not work. I originally tries something like this:

/[0-9]+0(;[0-9]+0)*(;off)?(;\?)?$/

To match a string that looks like "80;120;off;?" (OpenRailwayMap signal speed specification).

Attachments (0)

Change History (6)

comment:1 by Don-vip, 9 years ago

Keywords: mapcss added

comment:2 by naoliv, 9 years ago

Use double \\

Simple example that matches name=foo?:

*[name =~ /foo\\?/] {
        throwWarning: tr("foo in name");
}
Last edited 9 years ago by naoliv (previous) (diff)

comment:3 by naoliv, 9 years ago

Right, it seems I was too fast on this.
It doesn't work.

comment:4 by bastiK, 9 years ago

Resolution: fixed
Status: newclosed

In 8535/josm:

fixed #11598 - Cannot match literal quotation mark (?) in regular expression

comment:5 by Don-vip, 9 years ago

Milestone: 15.07

comment:6 by Don-vip, 9 years ago

Milestone: 15.0715.08

Milestone renamed

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.