Write a regular expression that accepts simple SQL select statements.
That is, any SQL statement that starts with "SELECT" followed by one or more comma-separated column names, followed by a single "FROM" keyword followed by one or more comma-separated table names and finished by an optional semi-colon (;).
A valid column or table name contains only letter characters (no spaces, numerical, or special characters), except that a column name (between SELECT and FROM) may optionally include a single "." within the string (not at the start or end).
SELECT and FROM must both be uppercased, but the rest of the string may be in any letter-casing format.
For example, the following four strings should match:
SELECT puppy FROM puppies;
SELECT pokemon.name, pokemon.nickname, type FROM pokemon;
SELECT FrOm FROM SeLeCT
SELECT quilts, quarts, quinoa FROM Qstore;
But the following five strings should not match:
FROM puppies SELECT puppy;
SELECT puppy FROM p.uppies;
SELECT .name, FROM puppies;
select foo from bar;
SELECT puppy FROM puppies WHERE puppy='mowgli';