Skip to content

Instantly share code, notes, and snippets.

@jasiek
Last active May 1, 2016 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasiek/4d0446b22bc095fa555b75b0a0e91183 to your computer and use it in GitHub Desktop.
Save jasiek/4d0446b22bc095fa555b75b0a0e91183 to your computer and use it in GitHub Desktop.
# https://en.wikipedia.org/wiki/Call_signs_in_the_United_Kingdom#Call_sign_assignments_for_amateur_radio
# This appears to work:
/
(?<reg>[UDJIMWPTHNSC]?)
(?<callsign>M\g<reg>[01356][A-Z]{3})|
(?<callsign>(G\g<reg>[123468][A-Z]{2,3})|
(G\g<reg>[07][A-Z]{3})|(G\g<reg>5[A-Z]{2}))|
(?<callsign>2[EUDJIMW][01][A-Z]{3})
/
# This doesn't:
/
(?<reg>[UDJIMWPTHNSC]?)(?<m_callsign>M\g<reg>[01356][A-Z]{3})|
(?<g_callsign>(G\g<reg>[123468][A-Z]{2,3})
(G\g<reg>[07][A-Z]{3})|(G\g<reg>5[A-Z]{2}))
(?<two_callsign>2[EUDJIMW][01][A-Z]{3})
(\k<m_callsign>|\k<g_callsign>|\k<two_callsign>)
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment