Skip to content

Regex, European Russia, Asiatic Russia #8

Description

@PD5DJ

I am working on a python based logbook.
The dxcc lookup is based on dxcc.json

Only I experience some Regex issues with European Russia and Asiatic Russia.

For example with: RV9AL

Filtering out R?8, R?9 and R?0 seams to be not possible with "prefix" & "prefixRegex"

Prefix and Regex of Asiatic Russia:
"prefix": "UA0,UA8,UA9,UB0,UB8,UB9,UC0,UC8,UC9,UD0,UD8,UD9,UE0,UE8,UE9,UF0,UF8,UF9,UG0,UG8,UG9,UH0,UH8,UH9,UI0,UI8,UI9,RA,RB,RC,RD,RE,RF,RG,RH,RI,RJ,RK,RL,RM,RN,RO,RP,RQ,RR,RS,RT,RU,RV,RW,RX,RY,RZ",
"prefixRegex": "^(U[A-I][089]|R[A-Z])[A-Z0-9/]*$",

Prefix and Regex of European Russia:
"prefix": "UA1,UA2,UA3,UA4,UA5,UA6,UA7,UB1,UB2,UB3,UB4,UB5,UB6,UB7,UC1,UC2,UC3,UC4,UC5,UC6,UC7,UD1,UD2,UD3,UD4,UD5,UD6,UD7,UE1,UE2,UE3,UE4,UE5,UE6,UE7,UF1,UF2,UF3,UF4,UF5,UF6,UF7,UG1,UG2,UG3,UG4,UG5,UG6,UG7,UH1,UH2,UH3,UH4,UH5,UH6,UH7,UI1,UI2,UI3,UI4,UI5,UI6,UI7,RA,RB,RC,RD,RE,RF,RG,RH,RI,RJ,RK,RL,RM,RN,RO,RP,RQ,RR,RS,RT,RU,RV,RW,RX,RY,RZ",
"prefixRegex": "^(U[A-I][1-7]|R[1-8])[A-Z0-8/]*$",

The problem lies in that both json records contain almost the same "prefixes", "RV"

Als when I try regex ^(U[A-I][089]|R[A-Z])[A-Z0-9/]*$ on https://regexr.com/ I get a pass on all RV1 to RV7

a better regex should be: ^(U[A-I][089]|R[A-Z])[089/]*$

But still both prefixes keep conflicting.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions