Hello guys, anyone can help me with an regular expression which can select the line before an match.
For example in this text I need to take the age “53” but sometimes is above and sometimes is after the “Age & Sex:” string.
Patient Name: Michael 53 Age & Sex: M/F Date of Use or
hey @Ionut_Frincu
You could use /d{2} to get 2 numbers for the age.
However the digits might come from the date portion also but you could extract the first part by:-
regex.fisrt()
regex - your regex var name
hope it helps
@Ionut_Frincu - Please try below… this simple pattern covers both the cases…but if you have any other digits in your string then shown pattern wont work…