regex - Java replace pattern -



regex - Java replace pattern -

i need replace rooms start , end tag xml file.

<a><rooms><b></b></rooms></a>

becomes

<a><b></b></a>

and

<a><rooms><b></b></rooms></a>

becomes

<a><b></b></a>

i tried

pattern.compile("\\\\\\\\<(.*)rooms\\\\\\\\>").matcher(xml).replaceall("")

, not work.

can help me?

your regex absurd. use:

xml = xml.replaceall( "</?rooms>", "" );

java regex

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -