我正在嘗試使用正則表達(dá)式來捕獲部分標(biāo)題,但是為什么我能夠用它捕獲“4.1 General”,但是如果我在正則表達(dá)式的末尾添加換行符,\n([\d\.]+ ?\w+)\n它不再捕獲該行?后面沒有換行還是我遺漏了什么?\n([\d\.]+ ?\w+)輸入3.6.10POLLUTION DEGREE 4continuous conductivity occurs due to conductive dust, rain or other wet conditions3.6.11CLEARANCEshortest distance in air between two conductive parts3.6.12CREEPAGE DISTANCEshortest distance along the surface of a solid insulating material between two conductiveparts4 Tests4.1 GeneralTests in this standard are TYPE TESTS to be carried out on samples of equipment or parts.\n([\d\.]+ ?\w+)\n? 似乎也不起作用。
使用正則表達(dá)式匹配多個(gè)標(biāo)題樣式
慕工程0101907
2021-07-12 16:56:27