Regular Expressions in Osmosis

Hi, Is it possible to use regular expression in Osomsis to extract specific data. for example, I want to extract all name tags which have a number in them.

I am not aware of such a feature neither for Osmosis, nor for OSMFilter.

Alternatively you can import raw OSM data in a database, and do your regex queries with means of classic database rules.

Osmosis has “Tag Transform”, which reportedly has regular expression support. See the wiki documentation.

Thanks for your reply. Please, can you explain me more? I haven’t worked with databases in OSM. And how I can then upload modified data?

Oooohhhh, new information about your aims!

As soon as you are a bit familiar with the JOSM editor (see http://wiki.openstreetmap.org/wiki/JOSM ) you can try its search feature which has a regex support, see https://josm.openstreetmap.de/wiki/Help/Action/Search

Maybe you have to activate expert mode inside JOSM first.

I’m completely familiar with JOSM, JOSM has search function but not replace function! I want to search and then modify a large amount of data.

Let me explain my more about what I want to do. I want really search for any feature in my country which its name is written in English. I want to filter these objects and then replace name tag with name:en tag and then write name tag in Persian. I do these tasks with Overpass turbo, a Notepad++ macro, and a Perl script, now. The only restriction is that Overpass turbo works on a small region. I want to extract these data directly from Iran .pbf file and then do these steps one time. Then, I can use OSM change files only for latter changes.

At least in most countries, this is not something that should be done mechanically because there are cases where the name on ground is not in the local alphabet.

Whilst I do observe an over use of English names in Asia, sometimes because ex-patriots are more likely to map than locals, and sometimes because English is a the language of the intellectual elite, and have commented on this in the past, there will still be cases where English is the correct language to use.

In London, there are areas where the correct scripts to use are Chinese, Bengali, Devnagari, Gujarati, Arabic, etc., either as the only language in the name, or as part of a name in both English and the other language.

As a continental country, I would expect there are border areas of Iran where languages other than Farsi dominate, and unless there is very strong political control, are used for the names on the ground. Even Great Britain has areas which are officially bilingual.

The general rule on bulk edits is that the local mapping community sets the policy, but such an edit would be controversial if the equivalent were done in the UK.

I have discussed legal or controversial issues of this process in another thread (http://forum.openstreetmap.org/viewtopic.php?id=53038), Now, I want only technical process.