PHP 查找字符串中包含句点并以 space 结尾的所有子字符串

PHP Find all substrings within a string that contain a period and end with a space

如何从 php 中的 $qryString 中获取下面的子字符串?我有一个包含 300 多个查询字符串的数据库。它们都使用点运算符进行格式化。我想将字符串输入函数并获得返回表的列表。

$qryString = "SELECT * FROM Database.dbo.table INNER JOIN Database.dbo.Anothertable WHERE... ";

//输出

Database.dbo.table

Database.dbo.Anothertable

查找 space 后跟单词字符 [\w]+ 后跟 . 后跟单词字符 [\w]+ 和 space 一次或多次+:

preg_match_all('/ ([\w]+\.[\w]+)+ /', $qryString, $matches);

$matches[0]中查找。