This is essentially the inverse of Generate a US License Plate
Challenge: Given a string that matches one of the below license plate formats, output all possible states that match that formatting. In the below table 0
stands for a single digit 0
through 9
inclusive, and A
stands for a single letter A
through Z
inclusive. For the purposes of this challenge, we're ignoring states with complex format rules (like Delaware, which has variable number of digits), and ignoring removal of look-alike letters (e.g., I
and 1
).
AAA 000: AK, IA, MS, MP, VT
0000: AS
AAA0000: AZ, GA, WA
000 AAA: AR, KS, KY, LA, ND, OR
0AAA000: CA
AA-00000: CT
AA-0000: DC
AAA A00: FL
AA 00000: IL
000A,000AA,000AAA,AAA000: IN
0AA0000: MD
AAA 0000,0AA A00,AAA 000: MI
000-AAA: MN
00A-000: NV
000 0000: NH
A00-AAA: NJ
000-AAA,AAA-000: NM
AAA-0000: NY, NC, PA, TX, VA, WI
AAA 0000: OH
000AAA: OK
AAA-000: PR
000-000: RI
AAA 000,000 0AA: SC
A00-00A: TN
A00 0AA: UT
Examples:
B32 9AG
[UT]
1YUC037
[CA]
285 LOR
[AR, KS, KY, LA, ND, OR] (in any order)
285-LOR
[MN, NM] (in any order)
285LOR
[IN, OK] (in any order)
Rules and Clarifications
- The input string is guaranteed non-empty, and guaranteed to be of one of the above formats
- Behavior if given a format other than the above is undefined
- Input and output can be given by any convenient method
- You can print the result to STDOUT or return it as a function result
- Either a full program or a function are acceptable
- Standard loopholes are forbidden
- This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins