Tuesday, 6 August 2013

To the last tag RegEx

To the last tag RegEx

I do not know what I am doing wrong. I have this string that I want to
replace
<?xml version="1.0" encoding="utf-8" ?>
<Sections>
<Section>
I am using regex to replace everything including <Section>, and leave the
rest untouched.
arrayValues[index].replace("/[([.,\n,\s])*<Section>]/", "---");
What is wrong with my regex? Doesn't this mean repalce every character,
including new line and spaces, up to and including <Section> with ---?

No comments:

Post a Comment