-1

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

GFR
  • 1
  • 2

1 Answers1

-1

Regex is not that bad but it requires a little reading but it’s the same in lost cases. Why not just use string find or split line by line?

Bayleef
  • 185
  • 2
  • 10