I want to writre a Regular Expression to divide these two lines into rows
ID : 1
Name : John
Last name : Doe
Age : 45
Your regex is almost correct, however it does not break the line when a space is encountered, so 45 and 2 appear on the same line, to fix this just add a space with
; in square brackets. And use the
\n subtitution like you did!