import java.io.IOException; public class RELPACE { public static void main(String[] args) throws IOException { replace("/Users/aboufahj/Documents/eclipse-mdht/workspace/EUU/modelisation/ihe.iti._2011.xdw.uml"); //replace("/Users/aboufahj/Documents/eclipse-mdht/workspace/EUU/modelisation/org.eclipse.emf.ecore.uml"); //replace("/Users/aboufahj/Documents/eclipse-mdht/workspace/EUU/modelisation/org.open.oasis.docs.ns.bpel4people.ws.humantask.types._200803.uml"); } public static void replace(String arg) throws IOException { String xdw = FileReadWrite.readDoc(arg); String res = xdw; res = xdw.replaceAll("\"pathmap://UML_LIBRARIES/XMLPrimitiveTypes.library.uml#.*?\"", "\"pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String\""); FileReadWrite.printDoc(res, (arg)); } }