Skip to content

Fix Consecutive Hyphens (--) Allowed in Braille Input #8

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Beeram12
Copy link

Fixes #6

Changes made

  1. Changed the regex from
^(?:1?2?3?4?5?6?)(?:-(?:1?2?3?4?5?6?))*$

to

^[1-6]+(?:-[1-6]+)*$

Explanation:
In my regex intially it checks only if numbers are from 1-6 and then hyphen - used to seperate again numbers from 1-6 and it goes on

I am happy to do if any changes are needed after review.

@jriyyya
Copy link
Member

jriyyya commented Feb 28, 2025

Even though your implementation successfully prevents a hyphen at the start and disallows multiple consecutive hyphens, it fails to enforce other crucial validation rules. The one I noticed were:

  • Numbers must be in sequential order (e.g., 2 cannot appear before 1, 3 cannot appear before 2, etc.).
  • Duplicate numbers are not allowed (e.g., 111 is invalid in Braille).
  • Valid Braille numbers are strictly limited to: 1, 12, 123, 1234, 12345, 123456, 2, 23, 234, etc.

@Beeram12
Copy link
Author

Beeram12 commented Mar 1, 2025

Thank you for your feedback.I improved the regex from before so that it could pass all the checks as mentioned although the regex is quite nested.Its working and I have tested it with some examples.If anything needed to be changed please let me know.

@Beeram12
Copy link
Author

Beeram12 commented Mar 13, 2025

@jriyyya
I hope anyone reviews this and be active in this community may I know any official channel where discussion related to GSOC is happening and also how to increase chance of slection.

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

Successfully merging this pull request may close these issues.

Consecutive Hyphens (--) Allowed in Braille Input
2 participants