Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not mutually exclusive #2

Open
mlforcada opened this issue Jun 24, 2021 · 2 comments
Open

not mutually exclusive #2

mlforcada opened this issue Jun 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@mlforcada
Copy link

Thanks a million for this.
Regular expressions for different DXCC entities do not always seem to be exclusive.
For instance, the Sardinian call sign IS0HNX would be matched, not only by the general Italy expression ^I[A-Z0-9/]$, code 248, but also by a specific Sardinia general expression: ^I[SM]0[A-Z0-9/]$, code 225. Is there any way to order the expressions so that these ambiguities are avoided? Thanks and 73

@xylo04 xylo04 added the enhancement New feature or request label Jun 24, 2021
@xylo04
Copy link
Member

xylo04 commented Jun 24, 2021

Hi Mikel: yes, this is a weakness of the current dataset. As a heuristic, I can attempt to order them by descending length of the regular expression, which should be good enough for most cases. As a workaround, that should also be simple to accomplish in programs consuming the data.

If you (or anyone else) is interested in trying to tighten up the regular expressions so that general matches (e.g. Italy) do not overlap with more specific ones (e.g. Sardinia) I'm happy to accept a pull request.

@rpsmendes
Copy link

rpsmendes commented Apr 3, 2022

Hi folks, found a workaround for this issue. Is not a perfet solution, even though it should work for almost every search without needing to re-write every single regex pattern.
image
In summary, after pattern matching succeedes I'm also checking if the given callsign begins with one of the prefixes.
Hope you guys could find it useful.
73s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants