1
The idea is to develop a tool that selects fields from a pre-formatted file according to a specific schema:
Schema:
1.
[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris efficitur
laoreet gravida. Nunc lacinia elit in nulla ultrices viverra eget eget
massa. Phasellus suscipit pharetra ex non euismod.
Sed mollis laoreet odio id blandit. Maecenas vel orci sed lacus commodo
commodo et a mauris.
{asd123ASD/asd123ASD/a1A/a1A/a1A -:_ }
]
Basically a text file with an index and a content between the [ ]
which highlight an unbounded string and a command block bounded by { }
.
The goal is to capture the data in groups. Ex.: Indexes, Text Commands.
I saw that an "easy" way to solve is by using RegEx
.
So I came to this:
(\d{1}[[:punct:]]\s*\[){1}(.*\s*\{)(.*\s*\])
https://regex101.com/r/Md4L6b/1
But this returning only 2 match where there should be 5.
Can someone tell me where I’m going wrong?