regular expression & XML

Hi all,

I have a simple XML to parse (I dont need XML parser just fir such thing). The XML is as below

<element name="uuid">

<value>1.0.199999102</value>

</element>

I need to read the value, which is 1.0.199999102. Could anyone give me the regular expression code to achieve this? Thanks in advance.

Cheers

[373 byte] By [oturcoa] at [2007-10-3 11:32:22]
# 1
Group 1 of "<value>([^>]*)</value>"
sabre150a at 2007-7-15 13:59:12 > top of Java-index,Other Topics,Algorithms...
# 2

Thanks, but one of my concerns is; if < value> xxxx< /value > is read then that statement will fail, i guess...

besides uuid is important as well, first i would like conform that then read the value;

1- check if name='uuid'

2- if yes, read the value

but there might be spaces, so I want to take this into consideration...Any help?:)

oturcoa at 2007-7-15 13:59:12 > top of Java-index,Other Topics,Algorithms...
# 3

> Thanks, but one of my concerns is; if < value>

> xxxx< /value > is read then that statement will

> fail, i guess...

Yes, but you did not specify that as a possibility. Try -

"<\\s*value\\s*>\\s*([^>]*)\\s*<\\s*/\\s*value\\s*>"

>

> besides uuid is important as well, first i would like

> conform that then read the value;

> 1- check if name='uuid'

So how would I know how to do that? I can show how to extract it but only you can test it.

> 2- if yes, read the value

Read the value regardless but only use if valid.

>

> but there might be spaces, so I want to take this

> into consideration...Any help?:)

Write down a better specification and then I may be able to help?

sabre150a at 2007-7-15 13:59:12 > top of Java-index,Other Topics,Algorithms...