I have a free form text file(Not XML) from which i would like to parse the lines between two patterns. Here is the sample data
<Hi>
col1 col2 col3
1 2 3
4 5 6
helo how are
<How>
col1 col2
1 2
helo hi'
I want to parse the data between each tag i.e <Hi> and the blank line as a single string. Similarly the data between <How> and the blank line as another string.
The regex pattern i tried so far did not work.
val pattern = "^<Hi>(.*)\\n"
val pattern = "^<Hi>(.*)\\s*$"
val pattern = "^<Hi>(.*)"
val pattern = "^<Network>(.*)((\\r\\n|\\n|\\r)$)|(^(\\r\\n|\\n|\\r))|^\\s*$"
Is there a way i can specify a pattern for the blank line. Any help is appreciated.
<Hi>([\s\S]+)(?=^$)Demo