从我读到的内容来看,如果我想捕获特定的单词,我可以使用单词边界。正则表达式边界混淆
我有以下信息
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