stefanwagner
Programmer
Well, I searched here without success, and don't get it by reading the java-docs.
I want to split a certain token like this:
<name>groovy</name>
to
<name>
groovy
</name>
(xml-tag, content, xml-tag)
I use string.replaceAll (pattern, matcher) like this:
(the typical hardly readable regex-syntax)
the result isn't - as intended - but:
The pattern is found, but the backreferences aren't interpreted the way I like.
How would I specify the capturing-group 1, 2, 3 correctly?
seeking a job as java-programmer in Berlin:
I want to split a certain token like this:
<name>groovy</name>
to
<name>
groovy
</name>
(xml-tag, content, xml-tag)
I use string.replaceAll (pattern, matcher) like this:
(the typical hardly readable regex-syntax)
Code:
tmp = tmp.replaceAll ("<([^>]+)>([^<]+)<([^>]+)>", "<\\1>\n\\2\n<\\3>");
Code:
<1>
2
<3>
How would I specify the capturing-group 1, 2, 3 correctly?
seeking a job as java-programmer in Berlin: