'Using multiline regular expressions

I need to separate individual records from:

Marriage of MARY ROCHE
in 1880
Group Registration ID   N/R
SR District/Reg Area    Cork
Returns Year    1880
Returns Quarter 4
Returns Volume No   5
Returns Page No 0110
Marriage of MARY ROCHE
in 1880
Group Registration ID   N/R
SR District/Reg Area    Enniscorthy
Returns Year    1880
Returns Quarter 3
Returns Volume No   4
Returns Page No 276
Marriage of MARY ROCHE
in 1880
Group Registration ID   N/R
SR District/Reg Area    New Ross
Returns Year    1880
Returns Quarter 3
Returns Volume No   4
Returns Page No 349
Marriage of MARY ROCHE
in 1880
Group Registration ID   N/R
SR District/Reg Area    Wexford
Returns Year    1880
Returns Quarter 3
Returns Volume No   4
Returns Page No 389
Marriage of MARY ROCHE
in 1880
Group Registration ID   N/R
SR District/Reg Area    New Ross
Returns Year    1880
Returns Quarter 3
Returns Volume No   4
Returns Page No 343

For instance the first record would be from Marriage (1st line) till 0110 (8th line).

How would you do that using regular expression in order to get a list with all the records?

thanks in advance



Solution 1:[1]

You can use below regular expression:

(Marriage).*?(?=Marriage|\Z)

Demo https://regex101.com/r/x2HPMK/1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pooverma