在创建xPath时需要帮助

编程入门 行业动态 更新时间:2024-10-26 09:20:33
本文介绍了在创建xPath时需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好 以下是我运行命令后得到的输出

Hi all below is the output i am getting after running a command

<output> <line index="1">system:!:0:root,appdet</line></output>

我只想从行数据中提取"root,appdet". 请告诉我怎么做.. 谢谢

I want to extract only "root,appdet" from the line data. Please tell me how to do this.. Thank you

推荐答案

您可以使用正则表达式解决此问题. 请参见 XQuery和XPath正则表达式 [ ^ ] 具体查看 You can use a regular expression to solve this problem. See XQuery and XPath Regular Expressions[^] Specifically look into fn:tokenize(subject, pattern, flags)

这种情况下的正则表达式可以是

The regex in this case could be

:(?<data>[a-z]+,[a-z]+)

注意:此正则表达式仅在您提出问题的特定情况下有效.

Note: This regex will only work under the specific circumstances you have given in your question.

更多推荐

在创建xPath时需要帮助

本文发布于:2023-10-26 23:09:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时需   xPath

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!