Question: Have a set of string as follows

```
text:u'MUC-EC-099_SC-Memory-01_TC-25'
text:u'MUC-EC-099_SC-Memory-01_TC-26'
text:u'MUC-EC-099_SC-Memory-01_TC-27'

```

These data i have extracted from a Xls file and converted to `string`,
now i have to Extract data which is inside single quotes and put them in a list.

expecting output like

```
[MUC-EC-099_SC-Memory-01_TC-25, MUC-EC-099_SC-Memory-01_TC-26,MUC-EC-099_SC-Memory-01_TC-27]

```

Thanks in advance.

Answer: 
Use [`re.findall`](http://docs.python.org/2/library/re.html#re.findall):

```
>>> import re
>>> strs = """text:u'MUC-EC-099_SC-Memory-01_TC-25'
text:u'MUC-EC-099_SC-Memory-01_TC-26'
text:u'MUC-EC-099_SC-Memory-01_TC-27'"""
>>> re.findall(r"'(.*?)'", strs, re.DOTALL)
['MUC-EC-099_SC-Memory-01_TC-25',
 'MUC-EC-099_SC-Memory-01_TC-26',
 'MUC-EC-099_SC-Memory-01_TC-27'
]

```
You can use the following expression:

```
(?<=')[^']+(?=')

```

This matches zero or more characters that are not `'` which are enclosed between `'` and `'`.

Python Code:

```
quoted = re.compile("(?<=')[^']+(?=')")
for value in quoted.findall(str(row[1])):
    i.append(value)
    print i

```