I do not think that there will be one regular expression that you can use for this, if it is not disgusting. I think the solution to this could be Natural Language Processing . Of course, there are packages for this, but using them may not be easy.
Essentially, you want to accept a sentence like "X is / was Y" and find out which part is the name, which part is the list of job names, and which parts are irrelevant. Perhaps find sequences of words that are either uppercase or small words like "and" and "from"?
(?:\u\w+)( (?:\u\w*)|(?:of)|(?:and))*
\u means that the next single character (the first character of the group \w+ ) is uppercase. Did not check it, but it looks like it should work. This may be a nontrivial problem.
andronikus
source share