我正在尝试从 SQL 文件中读取表,以下正则表达式适用于提取表名。但我也得到了应该被忽略的 SQL 注释行中的表。
(from|join|table)\s+([A-Za-z0-9_\.]+)
Ex:
-- select * from test_table--
select col1,col2 from table 1
inner join table2
....
I should get only table1 and table2
any help is much appreciated