I am using Python and would like to match all the words after "Examination(s):" till one or more empty lines occur.
text = "Examination(s):\sMathematics 2nd Paper\r\n\r\nTimeTable"
text = "Examination(s):\r\n\r\nMathematics 2nd Paper\r\nblahblah"
text = "Examination(s):\r\nMathematics 2nd Paper\r\n\r\n\r\nmarks"
In all the above examples, my output should be "Mathematics 2nd Paper". Here is what I tried:
import re
pat = re.compile(r'(?:Examination\(s\):)[^\r\n]*')
re.search(pat,text)
The above snippet works fine for example 2 (one occurrence of \r\n), but is not working for examples 1 and 3.
I am getting this error when i tried to apply your pattern @Wiktor
Updating the question to capture the missed scenario, it can be a space or newline after colon
[![enter image description here][2]][2]