Is it possible to do complex regex operations to retrieve name, role, designation in python? I have attached the pic for my requirement.

- 5,658
- 5
- 24
- 44

- 1,186
- 2
- 10
- 17
-
1If you plan to achieve this with regex operations, why did you tag your post with `nltk`? – lenz Aug 30 '16 at 18:14
-
try https://wit.ai/ – alvas Aug 30 '16 at 20:06
2 Answers
The answer is Yes and No.
Regex is pattern matching. Anything that follows a specific pattern like phone number and url, yes you can extract that information using Regex with a great degree of accuracy.
Refer:
For roles & designation, if there is a manageable list that be used as anchors, it is still possible to use regex to retrieve this information.
Retrieving names can be tricky or simple depending on how uniformly you capture the data. I have shared a simple example that will look for 2 consecutive words with first letter capitalized separated by a space. However it might have to be tweaked to include cases that does not follow this pattern.
^([A-Z]\w+)\s([A-Z]\w+).*?
So in summary, I would say yes you can use regex to some extend but it may or may not be the best solution depending on what you are trying to achieve.