Capture un texte sur plusieurs lignes (entre balise) puis supprimer un certain p

Signaler
Messages postés
1
Date d'inscription
mercredi 18 janvier 2012
Statut
Membre
Dernière intervention
18 janvier 2012
-
Bonjour
je viens vers vous après avoir testé plusieurs cas possibles pour ma regexp. Je pensais trouver sur le net une solution mais rien de bien probant ...

Voila ce que j'essaie de faire :
1) Capturer un texte entre "balises"
2) Supprimer toutes le occurences de "Req_Text\t" dans ma capture.

Le texte est le suivant :

Normal	
Req_Text	R5.1.2.1-3: When the default addressing model is used the wsman:ResourceURI reference parameter is required in messages with the following wsa:Action URIs:
Req_Text	
Req_Text	http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Put
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Create
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/enumeration/Renew http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatus http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
Req_Text	
Req_Text	the following messages require the EPR to be returned in the wse:SubscriptionManager element of the wse:SubscribeResponse message (WS-Eventing), the format of the EPR is determined by the service and might or might not include the ResourceURI:
Req_Text	
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew"
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus" 
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus
Normal	


1) je capture avec cette Regexp :
^Req_Text\tR[1-9\.-]+:([\s\S]+?)(?=^Normal)


When the default addressing model is used the wsman:ResourceURI reference parameter is required in messages with the following wsa:Action URIs:
Req_Text	
Req_Text	http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Put
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Create
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
Req_Text	 http://schemas.xmlsoap.org/ws/2004/09/enumeration/Renew http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatus http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
Req_Text	
Req_Text	the following messages require the EPR to be returned in the wse:SubscriptionManager element of the wse:SubscribeResponse message (WS-Eventing), the format of the EPR is determined by the service and might or might not include the ResourceURI:
Req_Text	
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew"
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus" 
Req_Text	http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus</code>


2) ayant la possibilité d'appliquer une "sous-regexp" à ma capture, je voudrais supprimer le pattern "Req_Text\t".

Le but est d'obtenir ca :
When the default addressing model is used the wsman:ResourceURI reference parameter is required in messages with the following wsa:Action URIs:
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
 http://schemas.xmlsoap.org/ws/2004/09/transfer/Put
 http://schemas.xmlsoap.org/ws/2004/09/transfer/Create
 http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
 http://schemas.xmlsoap.org/ws/2004/09/enumeration/Renew http://schemas.xmlsoap.org/ws/2004/09/enumeration/GetStatus http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
the following messages require the EPR to be returned in the wse:SubscriptionManager element of the wse:SubscribeResponse message (WS-Eventing), the format of the EPR is determined by the service and might or might not include the ResourceURI:
http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew"
http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus" 
http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus</code>


Et bah je ne sais absolument pas comment faire !!!

Si vous avez des pistes, ou alors si je suis passé à coté d'un topic, n'hésitez pas à me le dire.