I haven't done one before and I need to create a RegEx to validate an input box. #
represents a numeric and X
represents a letter. The format is:
11111 - XXXXXXX
or
11111 - XXXXXXX-XXXXXXXX XXXX
The inputbox has an autocomplete that is pulling from the database and returns a list that games with an ID followed by the organization name.
Such as:
1234 - Benjamin Franklin ISD
1234134 - Benjamin Franklin ISD - Humanities District
123434 - Benjamin-Franklin ISD
1234441 - Benjamin Franklin ISD Accelerated
Basically, the numbers before the first -
are the ID and anything following is the name of the organization that can possibly have a -
inside of it.
How do I handle it to where it can allow for both possible entries?
Any help would be greatly appreciated for the regex and/or resources!