1
I aim to perform the extraction of the substring delimited by ENTER
and Tempo de viagem total:4h 05m
in the text below:
For this I built the following regular expression: ENTER[\S\s]+Tempo de viagem total:.*h .*m
(general to work in any text)
However when extracting in the text below :
ENTERAZUL Linhas Aereas Brasileiras - 4884
ENTERAerospatiale/Alenia ATR 72
ENTERFev
ENTER1
ENTERBauru, SP, BR
ENTERSao Paulo, SP, BR
ENTER19:50JTC
ENTER20:50VCP
ENTERMoussa Nakhl Tobias Airport
ENTERViracopos International Airport
ENTER1h 00m
ENTEReconômica
ENTERExecutiva
ENTER1h 25m escala · Sao Paulo, SP, BR
ENTERAZUL Linhas Aereas Brasileiras - 4663
ENTERUnknown Aircraft
ENTERFev
ENTER1
ENTERSao Paulo, SP, BR
ENTERBrasilia, DF, BR
ENTER22:15VCP
ENTER23:55BSB
ENTERViracopos International Airport
ENTERBrasilia International Airport
ENTER1h 40m
ENTEReconômica
ENTERExecutiva
ENTEREmissões de CO2:econômica/Econômica "Premium": 154kg
ENTERExecutiva: 195kg
ENTERTempo de viagem total:4h 05m
ENTERAZUL Linhas Aereas Brasileiras - 4399
ENTERUnknown Aircraft
ENTERFev
ENTER5
ENTERBrasilia, DF, BR
ENTERSao Paulo, SP, BR
ENTER05:25BSB
ENTER07:05VCP
ENTERBrasilia International Airport
ENTERViracopos International Airport
ENTER1h 40m
ENTEReconômica
ENTERExecutiva
ENTER2h 25m escala · Sao Paulo, SP, BR
ENTERAZUL Linhas Aereas Brasileiras - 4530
ENTERAerospatiale/Alenia ATR 72
ENTERFev
ENTER5
ENTERSao Paulo, SP, BR
ENTERBauru, SP, BR
ENTER09:30VCP
ENTER10:35JTC
ENTERViracopos International Airport
ENTERMoussa Nakhl Tobias Airport
ENTER1h 05m
ENTEReconômica
ENTERExecutiva
ENTEREmissões de CO2:econômica/Econômica "Premium": 154kg
ENTERExecutiva: 195kg
ENTERTempo de viagem total:5h 10m
The substring end delimiter match is done with Tempo de viagem total:5h 10m
instead of Tempo de viagem total:4h 05m
resulting in the separation of the text, as if the search for the final delimiter was being carried out from the end of the text to the beginning.
Is there any way to perform this type of text search by searching for the first occurrence of the final delimiter ? (in this example first occurrence of Tempo de viagem total:.*h .*m
)
I’m using the site https://regexr.com/ to test