Input: 123456 789101112 123456 1234561
我只想選擇只有15位數字(不在中間)。如何在正則表達式中選擇確切的長度?
123456 789101112(長度16)然後我需要選擇123456.剩餘數字也需要選擇像這樣的邏輯。 (組每場比賽)。
output:
Match1: 123456
Match2: 789101112
Match3: 123456 1234561 (This is exact 15 digits from the space)
正則表達式:http://rubular.com/r/Zt0ib08Y6F
刪除空格,然後應用正則表達式。你在用什麼語言? – Maroun
對不起,但'123456'不是15或16位的子字符串。 –
嘗試'\ b \ d [\ d \ s] {0,13} \ d \ b' – ikleschenkov