Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

below is the output i am getting after running a command

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


I want to extract only "root,appdet" from the line data.

Please tell me how to do this..

Thank you
Posted

1 solution

You can use a regular expression to solve this problem.
See XQuery and XPath Regular Expressions[^]

Specifically look into
XML
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.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900