Php preg_match不是一个过滤器,请检查详细信息

Php preg_match不是一个过滤器,请检查详细信息,php,regex,preg-match,Php,Regex,Preg Match,我的数据库存储一个消息字符串及其相应的正则表达式,它替换一些变量信息,如日期、金额等。 一旦识别了regex并将其存储在数据库中,所有与数据库regex中类似的消息都应该使用preg_match过滤掉。 然而,当我在数据库中存储以下内容时,类似的消息不会被过滤掉 $message = Payment received NEFT - Your account account_number has been credited for some_amount from some_sender vide

我的数据库存储一个消息字符串及其相应的正则表达式,它替换一些变量信息,如日期、金额等。 一旦识别了regex并将其存储在数据库中,所有与数据库regex中类似的消息都应该使用preg_match过滤掉。 然而,当我在数据库中存储以下内容时,类似的消息不会被过滤掉

$message = Payment received NEFT - Your account account_number has been credited for some_amount from some_sender vide Txn ref some_ref_num.

$corresponding_regex = Payment received NEFT \- Your account (.*) has been credited for (.*) from (.*) vide Txn ref (.*)
我猜问题在于“NEFT”。因为,如果我删除它,类似的消息会被过滤掉。但是,我不能用。*代替NEFT,因为这些信息对我来说至关重要

如何确保在不替换我的正则表达式中的NEFT的情况下过滤出类似的消息?

将正则表达式中的。*更改为\S+

Payment received NEFT \- Your account (\S+) has been credited for (\S+) from (\S+) vide Txn ref (\S+)