在创建xPath时需要帮助 [英] Need help in creating xPath

查看:110
本文介绍了在创建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时需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆