regex - issue with regular expression in java -


i have string in format of xml

 <?xml version="1.0" encoding="utf-8"?>n   <objecta>n   <command>existing</command>n   <status>ok</status>n   <values>a lot of values....</values>n   </objecta> 

i want split array of string value , content

     [0] objecta = ""      [1] command = existing      [2] status = ok      [3] values = lot of values.... 

i tried

 result = result.replaceall(">n<", "><"); //$non-nls-1$ //$non-nls-2$  pattern pattern = pattern.compile("<*?>*?</*?>"); //$non-nls-1$ 

but is not working me

why not use xml parser?

element docelem = document.getdocumentelement();  nodelist children = docelem.getchildnodes();  list<string> values = new arraylist<string>();  for(int x = 0; x < children.getlength(); x++) {      // want children. came out wrong. } 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -