I’m trying to structure text using regular expressions – splitting and grouping all managers in the following example format:
General MANAGER
John Doe
(123) 456 7890
abcdefg@netcare.co.za
Nursing MANAGER
John Doe
(123) 456 7890
abcdefg@netcare.co.za
Financial MANAGER
John Doe
(123) 456 7890
Human Resource MANAGER
John Doe (Acting)
(123) 456 7890
abcdefg@netcare.co.za
Marketing OFFICER
John Doe
abcdefg@netcare.co.za
Pharmacy MANAGER
John Doe
(123) 456 7890
abcdefg@netcare.co.za
Technical Services MANAGER
John Doe
(123) 456 7890
abcdefg@netcare.co.za
I’ve tried
(?<FOUND>^.*?(manager|officer)+.*?)(manager|officer)+
expecting it to group items like this:
General Manager
John Doe
(123) 456 7890
abcdefg@netcare.co.za
but it’s not quite working. Can any regexpert tell me how to fix it?
I’m using http://regexhero.net/tester/ for testing with options:
CultureInvariant, ExplicitCapture, IgnoreCase, Multiline, SingleLine
With RegexOptions.Multiline | RegexOptions.IgnoreCase
See: http://regexhero.net/tester/?id=1ac1bd9f-be0a-4bea-ac01-cc32a6605ae7
Retrieve values using