I would like to find out if a select some_col_name, * , some_col_name from table_name
occurs in a query string like example below:
select some_col_name, *, some_col_names
from table_name
or
select some_col_name,
*, some_col_name
from
table_name
So far, I am only able to match select some_col_names, *
using
re.search("select(\s*.*?)*\*", query_string)
How do I match the desired expression? I would like to stop after matching the first occurrence.