====== Parsing TNC2 monitor frames ====== The following regexes enable you to parse AX.25 UI frames formatted according to the TNC2 Monitor format. ===== PCRE Regex ===== /^([0-9A-Za-z]+(?:-[A-Za-z0-9]+)?)>((?1))((?:,(?1)\*?)*),(qA[A-Z]),((?1)):(.+)$/gmu Matches are sorted as following: ^ group ^ type ^ | 1 | Sender | | 2 | Destination | | 3 | AX.25 path | | 4 | Q construct | | 5 | Source server | | 6 | Payload | ===== Javascript ===== /^(?[0-9A-Za-z]+(?:-[A-Za-z0-9]+)?)>(?[0-9A-Za-z]+(?:-[A-Za-z0-9]+)?)(?(?:,[0-9A-Za-z]+(?:-[0-9]+)?\*?)*),(?qA[A-Z]),(?[0-9A-Za-z]+(?:-[A-Za-z0-9]+)?):(?.+)$/gmu This regex features named groups: ^ group ^ type ^ | sender | Sender | | dest | Destination | | path | AX.25 path | | qcons | Q construct | | srvsrc | Source server | | payload | Payload |