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)
A voir également:
- PYTHON encore
- Citizen code python avis - Accueil - Outils
- Citizen Code : Saison 1 Episode 3, difficulté à comprendre - Forum Python
- Python est introuvable - Forum Python
- Citizen code python solution ✓ - Forum Python
- Python iptv forum ✓ - Forum Python
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