PYTHON encore
Fermé
julien
-
18 mars 2004 à 16:25
sebsauvage Messages postés 32893 Date d'inscription mercredi 29 août 2001 Statut Modérateur Dernière intervention 21 octobre 2019 - 18 mars 2004 à 18:29
sebsauvage Messages postés 32893 Date d'inscription mercredi 29 août 2001 Statut Modérateur Dernière intervention 21 octobre 2019 - 18 mars 2004 à 18:29
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
- Python generator - Télécharger - Sécurité
- Mot secret python pix ✓ - Forum Python
- Python pix ✓ - Forum Python
1 réponse
sebsauvage
Messages postés
32893
Date d'inscription
mercredi 29 août 2001
Statut
Modérateur
Dernière intervention
21 octobre 2019
15 662
18 mars 2004 à 18:29
18 mars 2004 à 18:29
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