The idea is to develop a tool that selects fields from a preformatted 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 [ ]
that highlights a non-delimited string and a command block delimited by { }
.
The goal is to capture data in groups. Ex .: Indexes, Texts Commands.
I saw that an "easy" way to solve is using RegEx
.
So I came to this:
(\d{1}[[:punct:]]\s*\[){1}(.*\s*\{)(.*\s*\])
But it's only returning 2 matches where they should be 5.
Can anyone tell me where I'm wrong?