Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 Changed 4 years ago by Don-vip

Keywords: mapcss added

comment:2 Changed 4 years ago by naoliv

Use double \\

Simple example that matches name=foo?:

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

comment:3 Changed 4 years ago by naoliv

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

comment:4 Changed 4 years ago by bastiK

Resolution: fixed
Status: newclosed

In 8535/josm:

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

comment:5 Changed 4 years ago by Don-vip

Milestone: 15.07

comment:6 Changed 4 years ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.