What I want to do
I'm writing a function that reads an xml file and sends some specific data to a Database. I'm not using a Parser because my file is super consistant and simple.
I want to choose only lines from this format:
<FIELDi>04/08/18</FIELDi>
where i is a natural number ranging [1,11].
Then, after having just those specific lines, I want to delete all spaces and all characters execpt the "data" between the patterns <FIELDi>
& </FIELDi>
.
For example, from <FIELDi>04/08/18</FIELDi>
, what left is 04/08/18
.
My Question
I'm coding in Java and don't know how to do it, I thought of using regex and wanted to know if there are simplier ways to do it.
If regex is the right way, what the expression should be?
Would appreciate your help