Skip to content

Regular Expressions for Highlighting Keywords

    In recent versions of AeroWeather (both Pro and Lite) we’ve added the possibility to use regular expressions for highlighting keywords in raw data. (METAR, TAF, ATIS, and NOTAM)

    Regular expressions (regex) are very powerful, but also quite obscure and complicated to use. To help you get started, we’ve collected a list of examples for various scenarios and show you how to adjust some of these regex.

    Cloud Ceiling

    OVC < 2000
    OVC0[0-1]\d

    To customise, adjust the “0-1” to your needs, e.g. “0-3” for below 4000 or “0-6” for below 7000.

    OVC >= 2000
    OVC(0[2-9]\d|[1-9]\d\d)

    For values between 1000 and 9000, this one can easily be adjusted: in the braked “2-9”, just update the first digit, e.g. 3 for greater than 3000. For 9000, remove the bracket all-together and just use “09\d”.

    BKN <= 2000
    BKN0([0-1]\d{1}|20)
    OVC < 1000
    OVC00\d

    Two more special cases.

    Visibility in KM

    Visibility < 8000
    \s([0-7]\d{3})\s

    To customize, adjust the second digit in the bracket accordingly, e.g. [0-5] for blow 6000.

    Visibility >= 5000
    \s([5-9]\d{3})\s

    Again, change the first digit in the bracket, e.g. [3-9] for greater 3000.

    Visibility in SM

    Visibility >= 10SM
    1\dSM

    Special case for anything equal or greater 10SM.

    Visibility >= 5SM
    ((0|\s)[5-9]|\d\d)(\s\d\/\d)?SM

    To adjust, change the first digit in the bracket. E.g. [7-9] for greater or equal than 7 SM.

    Visibility < 6SM 
    KT\s(\d\/\d|[0-5](\s\d\/\d)?)SM

    This includes all fractions of a SM, so 5 ½ would be included. To adjust, change the second digit in the bracket, e.g. [0-3] for smaller than 4 SM.

    Wind

    Wind >= 20 KTS
    \d{3}[2-9]\d(G\d\d)?KT

    Update the first digit in the bracket for other values, e.g. [4-9] for greater or equal than 40 KTS.

    Gusts >= 30 KTS
    \d{5}G[3-9]\dKT

    Update the first digit in the bracket to adjust, e.g. [2-9] for 20 KTS.

    More information for the curious

    Direct comparison of numbers in regex are not possible. Only single digits can be used to determine a positive match. That’s why some regex are quite long and complicated, even for a trivial comparison.

    Please also note, that you cannot use the comma “,” character in regex in AeroWeather, as we use the comma as a delimiter for simple keyword lists. Other than that, all standard regex functionality can be used.