I need a regex expression for the following text: I need the bold text
Notification number
Name
Address
Country
Notification
I have problems with my house.
Date
Department
I need a regex expression for the following text: I need the bold text
Notification number
Name
Address
Country
Notification
Date
Department
So you need the string before ‘Date’ and after 'Notification?
If so you can use a combination of look ahead and lookbehind as below:
(?<=Notification)\s+(.*)\s+(?=Date)
Thnx bro
Another question @TimK
If the notification is longer than a sentence? for example:
Notification
what if the report is longer than a line?
this is just an example
I am curious about this
it can therefore vary.
History
Date
Department
@Nalube So you want to change the way the regex looks at the string due to the multiple lines.
Your key identifier word has also changed from Date to History.
(?<=Notification)((?:.|\n)*)(?=\nHistory)
Please do look at Regex Learning to enhance your understanding of Regex
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.