Testing for a literal question mark

How would I write a regex style rule that fires when it encounters a question mark in a name? There is a group of local mappers that have used an invented name of "Ban ?" for towns they do not know the name of. I want to set the name to something more meaningful but I can't seem to discover a way to escape the ? without crashing mkgmap. -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

Hi Dave, I have a rule based on the following that includes a test for a question mark, and it seems to work fine: alt_name~'.*[!"$%\^&*_+=\[\]{}:;@~#<>,?/|\\].*' {echotags "Road with invalid character in alt_name"; delete alt_name} So I expect you should be able to put ~’.*[?].*’ as the test if the question mark is not accepted outside the square brackets. Regards, Mike From: Dave Swarthout [mailto:daveswarthout@gmail.com] Sent: 18 March 2015 14:28 To: Development list for mkgmap Subject: [mkgmap-dev] Testing for a literal question mark How would I write a regex style rule that fires when it encounters a question mark in a name? There is a group of local mappers that have used an invented name of "Ban ?" for towns they do not know the name of. I want to set the name to something more meaningful but I can't seem to discover a way to escape the ? without crashing mkgmap. -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

I am checking, if names only include ? and delete it with this rule name~'^(?=\s*\?)[?\s]+$' { delete name } Maybe it’s helpfull even if you are looking for a different solution. Walter From: Mike Baggaley Sent: Wednesday, March 18, 2015 4:53 PM To: daveswarthout@gmail.com ; 'Development list for mkgmap' Subject: Re: [mkgmap-dev] Testing for a literal question mark Hi Dave, I have a rule based on the following that includes a test for a question mark, and it seems to work fine: alt_name~'.*[!"$%\^&*_+=\[\]{}:;@~#<>,?/|\\].*' {echotags "Road with invalid character in alt_name"; delete alt_name} So I expect you should be able to put ~’.*[?].*’ as the test if the question mark is not accepted outside the square brackets. Regards, Mike From: Dave Swarthout [mailto:daveswarthout@gmail.com] Sent: 18 March 2015 14:28 To: Development list for mkgmap Subject: [mkgmap-dev] Testing for a literal question mark How would I write a regex style rule that fires when it encounters a question mark in a name? There is a group of local mappers that have used an invented name of "Ban ?" for towns they do not know the name of. I want to set the name to something more meaningful but I can't seem to discover a way to escape the ? without crashing mkgmap. -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com -------------------------------------------------------------------------------- _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

That did the trick. Here's my simplified version: (place=village | place=hamlet) & name~'.*[?].*' {delete name} I'm pretty sure I tried putting the question mark inside brackets but it didn't work. Maybe the enclosing quotes make a difference? At any rate, it's working now. Thank you and best regards, Dave On Thu, Mar 19, 2015 at 4:16 AM, Walter Schlögl < Walter.Schloegl-Resch@aon.at> wrote:
I am checking, if names only include ? and delete it with this rule
name~'^(?=\s*\?)[?\s]+$' { delete name }
Maybe it’s helpfull even if you are looking for a different solution.
Walter
*From:* Mike Baggaley <mike@tvage.co.uk> *Sent:* Wednesday, March 18, 2015 4:53 PM *To:* daveswarthout@gmail.com ; 'Development list for mkgmap' <mkgmap-dev@lists.mkgmap.org.uk> *Subject:* Re: [mkgmap-dev] Testing for a literal question mark
Hi Dave, I have a rule based on the following that includes a test for a question mark, and it seems to work fine:
alt_name~'.*[!"$%\^&*_+=\[\]{}:;@~#<>,?/|\\].*' {echotags "Road with invalid character in alt_name"; delete alt_name}
So I expect you should be able to put ~’.*[?].*’ as the test if the question mark is not accepted outside the square brackets.
Regards,
Mike
*From:* Dave Swarthout [mailto:daveswarthout@gmail.com] *Sent:* 18 March 2015 14:28 *To:* Development list for mkgmap *Subject:* [mkgmap-dev] Testing for a literal question mark
How would I write a regex style rule that fires when it encounters a question mark in a name?
There is a group of local mappers that have used an invented name of "Ban ?" for towns they do not know the name of. I want to set the name to something more meaningful but I can't seem to discover a way to escape the ? without crashing mkgmap.
--
Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
------------------------------ _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
participants (3)
-
Dave Swarthout
-
Mike Baggaley
-
Walter Schlögl