I have this list of strings in PYthon 2.7:
list_a = ['temp_52_head sensor,
uploaded by TS','crack in the left quadrant, uploaded by AB, Left in 2hr
sunlight','FSL_pressure, uploaded by RS, no reported vacuum','art
9943_mercury, Uploaded by DY, accelerated, hurst potential too
low','uploaded by KKP, Space 55','avogadro reading level,
uploaded by HB, started mini counter, pulled lever','no comment
yesterday, Uploaded to TFG, level 1 escape but temperature stable,
pressure lever north']
In each list item, there is a string
uploaded by SOMEONE
I need to extract SOMEONE.
However, as you can see, SOMEONE:
- changes from one item in the list to the next.
- can be 2 or 3 characters in length (text only, no numbers).
- occurs at different positions in the string.
- uploaded also occurs as Uploaded
- uploaded sometimes occurs before any comma
Here is what I need to pull out:
someone_names = ['TS','AB','RS','DY','KKP','HB','TFG']
I was thinking of using regular expressions, but the problems I am facing are from points 2. and 3. above.
Is there a way to pull out these characters from the list?