小编Ton*_*ony的帖子

正则表达式解析.net中的xml

我有以下的功能,我使用删除字符\ 04空值从我的xmlString,但我无法找到我需要做什么改变,以避免从我的结束标记去掉\.这是我运行此功能时得到的

<ARR>20080625<ARR><DEP>20110606<DEP><PCIID>626783<PCIID><NOPAX>1<NOPAX><TG><TG><HASPREV>FALSE<HASPREV><HASSUCC>FALSE<HASSUCC>
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我找出我需要在表达式中进行哪些更改以保留结束标记 </tag>

Private Function CleanInput(ByVal inputXML As String) As String
    ' Note - This will perform better if you compile the Regex and use a reference to it.
    ' That assumes it will still be memory-resident the next time it is invoked.
    ' Replace invalid characters with empty strings.
    Return Regex.Replace(inputXML, "[^><\w\.@-]", "")
End Function
Run Code Online (Sandbox Code Playgroud)

.net regex xml vb.net

6
推荐指数
1
解决办法
576
查看次数

标签 统计

.net ×1

regex ×1

vb.net ×1

xml ×1