Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Golang

`
^([a-zA-Z0-9-]{1,})>(.*?)[,](.*){1,},(qA[CXUoOSrRiZI]),(.+){1,}:
`
gm

Description

This re2 (using Go in my case) matches the APRS-IS header.

The format of the APRS-IS packet is TNC2 standard:

SOURCE>DESTINATION,PATH:PACKET

This regex matches the Q construct format used by APRS-IS:

``SOURCE>DESTINATION,PATH,QCON,FROMCALL:`

The result is a series of capturable groups:

Group 1: Src SSID Group 2: Dest SSID Group 3: Path Group 4: Q construct Group 5: From Calll

Submitted by Jack Hamm (jack@wv6l.net) - 2 years ago