我正在尝试使用正则表达式构造文本 - 以以下示例格式拆分和分组所有管理器:
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
我试过了
(?<FOUND>^.*?(manager|officer)+.*?)(manager|officer)+
期望它对这样的项目进行分组:
General Manager
John Doe
(123) 456 7890
abcdefg@netcare.co.za
但它并不完全有效。任何正则专家可以告诉我如何解决它?
我正在使用http://regexhero.net/tester/进行选项测试:CultureInvariant、ExplicitCapture、IgnoreCase、Multiline、SingleLine