You are not logged in.

#1 2020-06-12 15:22:56

Buster452
Member
From: Arizona
Registered: 2020-04-14
Posts: 21

JOSM Regex Search for Names beginning with numbers

I'm having great difficulty getting a regex expression to work.  I've tried several ways and not getting the results I want.

I want a filter that will give me all ways with a name beginning with a number.  It would be great if it returned any highways with names beginning with a number, but even just ways would work.

So far I'm enabled expert mode and tried
type:way ^name$~^/D
type:way ^name$~^/b[0-9
type:way name~^/b[0-9]


Nothing is giving me the results I want.  I'll be the first to admit that my regex skills really really suck.

Can anyone help?

Offline

#2 2020-06-12 15:39:02

AlaskaDave
Member
From: Homer, Alaska ; Chiang Mai
Registered: 2013-09-21
Posts: 371
Website

Re: JOSM Regex Search for Names beginning with numbers

I don't use regular expressions often but one resource that's been useful to me is the Online Regex Tester

My first shot at what you want is the regex string: ^[0-9]*.

Check this page out: https://regex101.com/  The Online Regex Tester is very helpful in getting the syntax right.

Arranging the regex string to work within a query is also tricky. You'll have to experiment with it to get results.

Offline

#3 2020-06-12 17:49:57

GerdP
Member
Registered: 2015-12-18
Posts: 1,113

Re: JOSM Regex Search for Names beginning with numbers

Did not try, my first guess would be  name~"^[0-9]+.*"

Offline

#4 2020-06-12 20:28:46

GerdP
Member
Registered: 2015-12-18
Posts: 1,113

Re: JOSM Regex Search for Names beginning with numbers

Works, so, your filter should be

type:way highway=* name~"^[0-9]+.*"

Offline

#5 2020-06-13 06:32:58

Buster452
Member
From: Arizona
Registered: 2020-04-14
Posts: 21

Re: JOSM Regex Search for Names beginning with numbers

That is AWESOME.  Thank you so much!

That'll make my life a lot easier fixing some road names in national forests.

Offline

#6 2020-06-13 18:57:01

Viajero Perdido
Member
Registered: 2016-10-13
Posts: 103

Re: JOSM Regex Search for Names beginning with numbers

That helped me too.  Thanks!

Offline

#7 2020-06-14 01:59:55

nevw
Member
From: SE Queensland, Australia
Registered: 2013-04-11
Posts: 405

Re: JOSM Regex Search for Names beginning with numbers

Helped me too, tks
and for the Overpass Turbo Query Wizard http://overpass-turbo.eu/
type:way and highway=* and name~"^[0-9]+.*"
or for checking nodes, ways and relations...
highway=* and name~"^[0-9]+.*"

Last edited by nevw (2020-06-14 02:08:24)

Offline

Board footer

Powered by FluxBB