PYTHON encore
julien
-
sebsauvage Messages postés 33284 Date d'inscription Statut Modérateur Dernière intervention -
sebsauvage Messages postés 33284 Date d'inscription Statut Modérateur Dernière intervention -
if re.search('\.\/(.*)',link):
Je voudrais récupérer ce qu'il y entre parenthèse ci dessus et le mettre après ce qu'il y a entre parenthèse ci dessous
lien=re.search('(.*\/).*\.html$',url)
Je voudrais récupérer ce qu'il y entre parenthèse ci dessus et le mettre après ce qu'il y a entre parenthèse ci dessous
lien=re.search('(.*\/).*\.html$',url)
1 réponse
Tu pourrais utiliser re.sub(), c'est justement fait pour ça.
Quelques lectures:
http://www.amk.ca/python/howto/regex/regex.html
http://diveintopython.org/regular_expressions/index.html
Quelques lectures:
http://www.amk.ca/python/howto/regex/regex.html
http://diveintopython.org/regular_expressions/index.html