章のタイトルをタイトル番号とタイトル名に分割する必要があります。章のタイトルの形式は次のとおりです。
some long text
3.7.2 sealant durability
paragraph with text // (.*)
3.7.3 funkční schopnost
paragraph with text...
3.1.13 plastic sealant xx 21
paragraph with text
3.1.14 plastic sealant
xx 21
paragraph with text
3.7.12 sealant durability
paragraph with text
3.7.325 funkční schopnost
編集: 問題は、図解された値が長いテキストの間にあり、特殊文字でいっぱいになっていることです。
以前はコードに従っていましたが、最後のドットの後の最後の桁のみが分割されていました。最後の「\d」の後に「+」文字を入力すると、エラーがスローされます。この問題の正しい正規表現は何ですか?
title.trim().split("(?<=(\\d\\.\\d{1,2}\\.[\\d]))")
期待される出力:
splitedValue[0] : '3.7.2'
splitedValue[1] : 'sealant durability'
...
splitedValue[0] : '3.1.14'
splitedValue[1] : 'plastic sealant xx 21'
...