Extract string that is delimited with constant and ends with two numbers (numbers have to be included)
- by Edmon
I have a text that contains string of a following structure:
text I do not care about, persons name followed by two IDs.
I know that:
a person's name is always preceded by XYZ code and that is always followed by
two, space separated numbers.
Name is not always just a last name and first name. It can be multiple last or first names
(think Latin american names).
So, I am looking to extract string that follows the constant XYZ code and that is always terminated by two separate numbers.
You can say that my delimiter is XYZ and two numbers, but numbers need to be part of the extracted value as well.
From
blah, blah XYZ names, names 122322 344322 blah blah
I want to extract:
names, names 122322 344322
Would someone please advise on the regular expression for this that would work with Python's re package.