Opened 8 months ago

Closed 8 months ago

Last modified 5 months 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:

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 8 months ago.

Download all attachments as: .zip

Change History (12)

Changed 8 months ago by Allroads

Attachment: lanes negated.JPG added

comment:1 Changed 8 months ago by Allroads

Description: modified (diff)

comment:2 Changed 8 months ago by Allroads

Description: modified (diff)

comment:3 Changed 8 months ago by Klumbumbus

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 Changed 8 months ago by anonymous

I tried that, before.
this did not work for 10.


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 Changed 8 months ago by Klumbumbus

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

comment:6 Changed 8 months ago by Allroads

Above Comment (by anonymous): Is mine.

comment:7 in reply to:  5 Changed 8 months ago by Allroads

Replying to Klumbumbus:

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

This works!



comment:8 Changed 8 months ago by Klumbumbus

Resolution: invalid
Status: needinfoclosed

comment:9 Changed 5 months ago by Allroads

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 Changed 5 months ago by Klumbumbus

Try woodchips)$ instead of woodchips$)

comment:11 Changed 5 months ago by Allroads

Correct, thanks, my failure.

Modify Ticket

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