我正在使用 preg_match_all() 来匹配一些字符串。
这是我的代码
preg_match_all('@([a-zA-Z0-9,\(\)\-\s\.\#:]*)Date From: [0-9]{2}/[0-9]{2}/[0-9]{4}([, \s]*[0-9]{2}/[0-9]{2}/[0-9]{4})*\s(Division Type: [A-Z ]*)*@m', $string, $match);
这是输出
https://regex101.com/r/hE3iO2/1
现在,我想/
在第一个组中添加一个以将文字包含/
在捕获组中,这会发生
由此
([a-zA-Z0-9,\(\)\-\s\.\#:]*)
对此
([a-zA-Z0-9,\(\)\-\s\.\#:/]*)
https://regex101.com/r/wM1rW7/1
/
添加到组时如何防止这种情况发生?