Trying to select DynamoDB table name using Regex pattern

Hello!

I am trying to build an app that connects to a DynamoDB table that uses a specific table naming pattern across environments, and I'm hoping to be able to match against a Regex pattern to then select the table name from the list of available tables that Retool has context for (since it can give you a dropdown list to select from to statically define the table name for the resource query). Does anyone know how I can access that table name list in a script somehow so I can return the correct table name for the environment in question?