The workspace contains a partially broken implementation at /app/starter_code.py. Your task is to fix the bugs and complete the implementation so that a precompiled SQL table name validator is provided via the sqlitemap package.
What to implement
Create a precompiled regular expression named table_name_re and expose it via the sqlitemap package (i.e., so that you can import it with from sqlitemap import table_name_re).
The regex should validate SQL table names by allowing only typical identifier characters and enforcing a safe start rule.
Exact requirements
The validator must accept:
Names starting with a letter or underscore
Followed by any number of letters, digits, or underscores
Examples: "users", "_temp", "User123"
The validator must reject:
Names starting with a digit
Names containing spaces or punctuation (e.g., "order-details", "employee data", "table-name")
Names with other disallowed characters (e.g., hyphens, spaces, dots)
The validation should be implemented as a single, compiled regex assigned to table_name_re
The regex must be anchored to ensure full-string matches (use ^ and $)
The implementation must be self-contained (no external dependencies) and compatible with Python 3.x
The module should be importable as: from sqlitemap import table_name_re
Include a brief module-level explanation (docstring) of the rule being enforced
The code should be placed in /app/starter_code.py; ensure the sqlitemap package exports table_name_re (adjust init.py if needed) so that the import works as described.
What the code should look like (conceptual)
A file sqlitemap/init.py (or equivalent import path) that ensures table_name_re is exposed, e.g.:
If /app/starter_code.py is the source, ensure init.py re-exports table_name_re from that module
Notes
Do not rely on or import tests-specific data; the implemented rule should generalize to the given tests (good_table_names and bad_table_names) that rely on this exact pattern.