python - regex to extract part of filename -


i want extract part of filename contained in xml string

sample

<assets> <media width="100%" height="100%" img="/assets/560pegnr/kvvnkfox7w9tf7.jpg"  valign="top"/> <media width="100%" height="100%" img="/assets/560pegnr/kvvnkfox7w9tf5.jpg"  valign="top"/> <media width="100%" height="100%" img="/assets/560pegnr/kvvnkfox7w9tf4.jpg"  valign="top"/> </assets> 

i want match , retrieve 560pegnr portion entries, regardless of filename

so far have

/assets/(.*)/*" 

but doesn't want

any appreciated

thanks

you should try with:

/assets/(.*?)/.* 

.* gready, using ? stops on first /.


Comments