Natta
Natta

Reputation: 755

Regexp groovy

I need a regexp to find strings that start with a specific word then comes colon and whitespace for example

"ErrorID: blabla"

Please help. :(

Upvotes: 1

Views: 385

Answers (2)

morja
morja

Reputation: 8550

This should do what you want:

^ErrorID: .*$

Upvotes: 2

Czechnology
Czechnology

Reputation: 14992

This should work fine:

^(\w+): (.+)$

First match group will give the first word (e.g. ErrorID), second the rest (e.g. blabla).

Exact implementation would depend on the programming language you use.

Upvotes: 3

Related Questions