3
I would like a light for my problem. My goal is to pick up the list below by dividing the blocks between the words LOREM
and LOREM
but I don’t want to pick up the whole text that follows at the end of the list pattern, as follows example:
LOREM : 10505050
IPSUM : 1050051051084
DOLOR : 2620620620652
AMETI : 54084840540540
LOREM : 10505050
IPSUM : 1050051051084
DOLOR : 2620620620652
AMETI : 54084840540540
LOREM : 10505050
IPSUM : 1050051051084
DOLOR : 2620620620652
AMETI : 54084840540540
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
I’m using this regex: /(?=LOREM :).+?(?:(?=LOREM :))/s
I’m able to select all, but the last block of text I can’t select.
To better understand follow this example: https://regex101.com/r/gM2fF1/1
You want to take all occurrences of
LOREM : número
andLorem seguindo de qualquer coisa
(this is the last block you can’t capture) ?– rray
@lost that. I can’t capture the last block. The only one though, is that sometimes some don’t come with just numbers.
– Diego Henrique