gpt4 book ai didi

c# - 正则表达式匹配

转载 作者:太空狗 更新时间:2023-10-29 22:19:40 25 4
gpt4 key购买 nike

如何从

中获取 |ADT^A05|

"MSH|^~\&|PHTADT09|ABC|DADIST00|ABC|20120425152829|rcalini1|ADT^A05|20429208851634|P|2.1|560"

我试过了,但是不行

"|([A-Z]{3})^([A-Z]{1})([0-9]{2})|"

最佳答案

当有像 | 这样的分隔符时,我认为你不需要正则表达式

var adt = text.Split('|')[8];

参见HL7的定义格式

Each segment in a message is divided into composites, or fields, and the fields are separated by pipe characters ('|')

关于c# - 正则表达式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13849067/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com