Invert a regular expression match in Overpass API

137 Views Asked by At

I want to search for possibly wrong ICAO codes using Overpass API. While matching an ICAO code is fairly trivial with the RegEx ^[A-Z]{4}$, I'm trying to match everything that does not match this RegEx. How can I negate the RegEx?

I want to use this RegEx in the tool Overpass-Turbo.

1

There are 1 best solutions below

1
InSync On BEST ANSWER

According to the docs, you can use the !~ operator to match the invert of ^[A-Z]{4}$:

nwr["icao"!~"^[A-Z]{4}$"]