Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17415 closed enhancement (invalid)

JOSM negated regular expression match, question.

Reported by: Allroads Owned by: Allroads
Priority: normal Milestone:
Component: Core mappaint Version:
Keywords: Cc:

Description (last modified by Allroads)

When I use a code:

[highway][lanes][lanes!~/1|2|3|4|5|6|7/]::highway_lanes_layer
to exclude: negated ​Regular expression match, all others should get a "else" icon Then I have a lanes=10 on a way. This 10 should get a "else" icon, This icon is not showing, because 10 has number 1 in 10, the program can not choose. If I have lanes=8 or lanes=9, I get the "else" icon.

What am I doing wrong?


Attachments (1)

lanes negated.JPG (154.7 KB ) - added by Allroads 6 years ago.

Download all attachments as: .zip

Change History (12)

by Allroads, 6 years ago

Attachment: lanes negated.JPG added

comment:1 by Allroads, 6 years ago

Description: modified (diff)

comment:2 by Allroads, 6 years ago

Description: modified (diff)

comment:3 by Klumbumbus, 6 years ago

Owner: changed from team to Allroads
Status: newneedinfo

^ and $ mark the beginning and ending of a regexp match. Change [lanes!~/1|2|3|4|5|6|7/] to [lanes!~/^1|2|3|4|5|6|7$/] and it should work.

comment:4 by anonymous, 6 years ago

I tried that, before.
way|z18-19["highway"]["lanes"][lanes!~/^1|2|3|4|5|6|7$/]::highway_lanes_layer
this did not work for 10.

THIS WORKS !
way|z18-19["highway"]["lanes"][lanes!~/^1$|^2$|^3$|^4$|^5$|^6$|^7$/]::highway_lanes_layer

Thanks for pushing me to do the most comprehensive method.

Now I have to redo the smoothness category too, I think, horrible in [smoothness!~/horrible|very_horrible/

in [smoothness!~/^horrible$|^very_horrible$/

When someone write terrible_horrible, it should give also "else" icon, seeing there is maybe a mistake or different writing. If /horrible/ is there, it negate terrible_horrible too, what is then not correct.

Should the info page be updated?

comment:5 by Klumbumbus, 6 years ago

Ah, grouping brackets were missing. Try this: [lanes!~/^(1|2|3|4|5|6|7)$/]

comment:6 by Allroads, 6 years ago

Above Comment (by anonymous): Is mine.

in reply to:  5 comment:7 by Allroads, 6 years ago

Replying to Klumbumbus:

Ah, grouping brackets were missing. Try this: [lanes!~/^(1|2|3|4|5|6|7)$/]

This works!

way|z18-19["highway"]["lanes"][lanes!~/^(1|2|3|4|5|6|7)$/]::highway_lanes_layer

Thanks.

comment:8 by Klumbumbus, 6 years ago

Resolution: invalid
Status: needinfoclosed

comment:9 by Allroads, 6 years ago

way|z18-["highway"]["surface"="metal"]::highway_surface_layer { 
    repeat-image: highway-surface-metal.svg;

/* Last surface tag Else.*/     
way|z18-["highway"]["surface"][surface!~/^(asphalt|cobblestone|compacted|concrete|concrete:lanes|concrete:plates|dirt|earth|fine_gravel|grass|grass_paver|gravel|gravel_turf|ground|ice|metal|mud|paved|paving_stones|pebblestone|salt|sand|sett|snow|unhewn_cobblestone|unpaved|wood|woodchips$)/]::highway_surface_layer { 
    repeat-image: highway-surface-else.svg;
}

I noticed today that surface=metal_grid did not give a else image. It should.
When I use instead grid_metal it gives a else image.

Both should get else image.

comment:10 by Klumbumbus, 6 years ago

Try woodchips)$ instead of woodchips$)

comment:11 by Allroads, 6 years ago

Correct, thanks, my failure.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Allroads.
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.