1
今天,我已經閱讀堆棧溢出的問題,在這裏:https://stackoverflow.com/questions/32151810/how-to-parse-this-text-block-into-variables-by-php我自己的PHP正則表達式代碼有什麼錯誤?
我曾嘗試使用此代碼做到這一點:
preg_match("/([a-zA-Z_]+)/", "[first_text] = [second_text, third_text] : [forth_text, fifth_text]", $matches);
當我測試了它,它並沒有正常工作:
echo $matches[0];
echo $matches[1];
echo $matches[2];
echo $matches[3];
echo $matches[4];
會打印:
first_textfirst_text
我自己的PHP正則表達式代碼中的錯誤是什麼?