Regular Expressions 101

Community Patterns

ogn-receiver-beacon

1

Regular Expression
PCRE (PHP <7.3)

/
(?<callsign>\w+?)>APRS,.+?, (?<receiver>\w+):\/ (?<time>\d{6})h (?<latitude>\d{4}\.\d{2}[NS]). (?<longitude>\d{5}\.\d{2}[EW]). (?:(?<heading>\d{3})\/(?<ground_speed>\d{3}))?.*? \/A=(?<altitude>\d{6})\s (?:!W((?<latitude_enhancement>\d)(?<longitude_enhancement>\d))!)? (?:v(?<version>\d+\.\d+\.\d+)(?:\.(?<platform>.+?))?\s)? CPU:(?<cpu_load>[\d.]+)\s RAM:(?<ram_free>[\d.]+)\/(?<ram_total>[\d.]+)MB\s NTP:(?<ntp_offset>[\d.]+)ms\/(?<ntp_correction>[+-][\d.]+)ppm\s? (?:(?<cpu_temperature>[+-][\d.]+)C\s*)? (?:RF: (?: (?<manual_correction>[+-][\d]+) (?<automatic_correction>[+-][\d.]+)ppm\/ )? (?<signal>[+-][\d.]+)dB )?
/
gx

Description

Parse ogn-flavored aprs messages, here especially receiver beacons.

source: https://github.com/svoop/ogn_client-ruby

Submitted by anonymous - 8 years ago