PHP を使用して、番号付きリストを含む文字列から配列を抽出しようとしています。
文字列の例:
The main points are: 1. This is point one. 2. This is point two. 3. This is point three.
次の配列になります。
[0] => 1. This is point one.
[1] => 2. This is point two.
[2] => 3. This is point three.
文字列の形式はさまざまです。例:
1. This is point one, 2. This is point two, 3. This is point three.
1) This is point one 2) This is point two 3) This is point three
1 This is point one. 2 This is point two. 3 This is point three.
次のパターンでpreg_match_allの使用を開始しました。
!((\d+)(\s+)?(\.?)(\)?)(-?)(\s+?)(\w+))!
しかし、残りの文字列/次の一致までを一致させる方法がわかりません。
RegExrで利用可能な例