我有一個像這樣的內容的字符串。PHP:正則表達式,preg_split
19. Which of the following conflicting criteria does the problem below satisfe. 2.1
C++ pointers are powerful and very flexible but at the cost of poor intelligibility.
a. Writability vs Readability
b. Reliability vs Cost of execution
c. Writability vs Reliability
d. Cost of execution vs. Readability
e. Cost of execution vs. Readability
我想要做的就是像這樣拆分它。
[0] => 19. Which of the following conflicting criteria does the problem below satisfye. 2.1
C++ pointers are powerful and very flexible but at the cost of poor intelligibility.
[1] => a. Writability vs Readability
[2] => b. Reliability vs Cost of execution
[3] => c. Writability vs Reliability
[4] => d. Cost of execution vs. Readability
[5] => e. Cost of execution vs. Readability
我的正則表達式很弱,我有這種結果。
preg_split('/(?=[a-e\d]+\.(?!\d))/', $entries, -1, PREG_SPLIT_NO_EMPTY);
[0] => 1
[1] => 9. Which of the following conflicting criteria does the problem below satisfy
[2] => e. 2.1
C++ pointers are powerful and very flexible but at the cost of poor intelligibility.
[3] => a. Writability vs Readability
[4] => b. Reliability vs Cost of execution
[5] => c. Writability vs Reliability
[6] => d. Cost of execution vs. Readability
[7] => e. Cost of execution vs. Readability
我應該怎麼做?
爲什麼不換行換行符? 「C++指針在自己的路線上強大」? e.'如何生成? – chris85
C++指針功能強大,是第一行的一部分。我不能爆炸它。 – Ian
爲什麼你不能爆炸呢?爆炸在本地測試中工作正常......我仍然沒有看到「e」來自哪裏,但我認爲這是一個錯字? – chris85