Reputation: 5160
i have trouble to extract a error message. My error message start with error: and i want to have the text after the error: to the end of the line.
Can anybody help my please?
example:
error: my error text
I wanna extract
my error text
I'm only able to select the whole line.
Thanks in advance Tonka
Upvotes: 1
Views: 38
Reputation: 2347
Since you did not specify what language you are using, you can use lookbehind.
(?<=error: )(.*)
This looks for lines starting with "error:
", and matches everything that follows afterwards. This will match a single line though.
Upvotes: 1
Reputation: 24812
If your messages always start with error:
you might as well just use substring. You didn't say which language you were using, but this would do the trick in javascript :
message.substring(7)
Upvotes: 1