從我讀到的內容來看,如果我想捕獲特定的單詞,我可以使用單詞邊界。正則表達式邊界混淆
我有以下信息
First: 12345Z Apr 16 Something WORD: ABC Notification #1234 Key1 Key2 Key3 Key4
Second: 12345Z Apr 16 Something WORD: ABC Notification #1234 Key5 Key3 Key6
Third: 12345Z Apr 16 Something WORD: ABC Notification #1234 Key7 Key6
我用下面的正則表達式,當我需要匹配Key3 Key4 Key6 Key7
(?<=#\d{4}\s)(\b(Key3|Key4|Key6|Key7)\b)
你在做什麼,如果它只是不#'後跟隨1234' – rock321987
感謝我剛纔注意到,以及更新將不會與任何關鍵字匹配。感謝這篇文章 – JeremyA1