Extract information from a text using regular expression

0

Good afternoon guys.

I'm developing a regular expression to extract information from a text. I want to get only one paragraph. The default of the text I am extracting is: it always starts with "Process XXX" and "ends with a date".

The regular expression I'm using is as follows:

Processo\s\d{3,3}.*(\n.*)*\d{2,2}\/\d{2,2}\/\d{4,4}

The problem is that it ends in the last block. I would like to get only the full paragraph.

Example of text to be extracted:

Process 001 Included
on tariff for 01/03/2016, at 08:30. Become aware lawyers that the summons shall take place at the trial session, in accordance with of article 47 of the internal regiment of the Recursal Class. 03/03/2015 Process 001 Included on the agenda for 01/03/2016 at 08:30. Stay lawyers to the effect that the summons shall take place at the trial session, in accordance with of article 47 of the internal regiment of the Recursal Class. 03/02/2015

When you execute the expression in this text, everything is selected.

    
asked by anonymous 05.02.2016 / 20:21

1 answer

0
Processo.+?((?=\n?Processo)|(?>\d{4}$))

Link where I found the solution: link

    
06.02.2016 / 16:28