Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下文字
{1:F01BSUIARP0XXXX7825287830}{2:I942CRAYIGS0XXXXN}
我用来提取值的正则表达式
{1:F01(?<SwiftTerminal>.{7}).*{2:I(?<MessageType>\d{3})(?<xxx2>.{12}).*\r\n
对于 SwiftTerminal,我希望结果附加 AAAA(4 个字符),我尝试使用 Backrefernece \K 但未找到匹配项。
请帮我写正则表达式
删除?第三个捕获组开始处的
?
{3})(.{12})
这导致正则表达式失败。没有它,正则表达式将匹配,您将能够找到匹配项并随意使用它们/附加到它们。