0
我想忽略捕獲組內的空白,有沒有辦法做到這一點,因此:忽略捕獲組內信
preg_split('#test[a-zA-Z0-9\s]*test#', $str, -1, PREG_SPLIT_DELIM_CAPTURE)
在任何一個:
'A AtestA4 testZ Z'
'A AtestA4 testZ Z'
'A AtestA 4 testZ Z'
'A AtestA4testZ Z'
所有返回
array(
[0] => 'A A',
[1] => 'testA4',
[2] => 'Z Z'
)
不要你的意思'的preg_match()','沒有的preg_replace()'? – Barmar
@Barmar哎呀,我其實是分裂 – qwertymk
目前還不清楚你想要什麼,但你可能要求斷言'(?= ...)' – mario