Reputation:
I have some sentences:
[1, 23] fun(): Error Code: 1230. fun doen't exist
Error Code: 1123. Unknown column 'hhh'
END: Error Code: 2134. database doen't exist
Now my concern is i want to get output like
['Error Code: 1230. fun doesn't exist','Error Code: 1123. Unknown column 'hhh'','Error Code: 2134. database doen't exist ']
I use \sError\s
this regex , but it didn't work , i do code in python
How to make a regex for it?
Upvotes: 1
Views: 63
Reputation: 627469
You may use
re.findall(r'\bError Code.*', s)
Details
\b
- a word boundaryError Code
- a literal substring.*
- the rest of the line.See the regex demo.
Upvotes: 2