假設我有一個文本文件,其內容類似于以下內容:021 Line one of section A.021 Line two of Section A.021 Line three of section A.021 Part two of Line three of Section A.021 We just skipped line four, but that's okay.021 Back to line six.Non-formatted lines to be ignored. This can be from 0 lines, to any number of lines, and the content can be any text.033 Line 1 of Section B033 Line 2 of Section B033 Okay, that's enough.是否可以在正則表達式中給我兩組,第一組包含所有以開頭的行021,第二組包含所有以開頭的行033?行標記會有所不同,但始終是\d{3}.
添加回答
舉報
0/150
提交
取消