Si ceci -> 123 Foo "Chaîne avec des espaces" < - est votre structure pour un ligne c'est-à-dire texte suivi d'un texte cité vous pouvez créer 2 groupes le texte cité et non coté et les aborder séparément.
ex.regex ->(.*)(".*")
où 1 $ doit contenir -> 123 Foo < - et 2 $ -> "String avec des espaces" < -
exemple java.
String aux = "123 Foo \"String with spaces\"";
String regex = "(.*)(\".*\")";
String unquoted = aux.replaceAll(regex, "$1").replace(" ", "");
String quoted = aux.replaceAll(regex, "$2");
System.out.println(unquoted+quoted);
Exemple javascript.
<SCRIPT LANGUAGE="JavaScript">
<!--
str='1 23 Foo \"String with spaces\"';
re = new RegExp('(.*)(".*")') ;
var quoted = str.replace(re, "$1");
var unquoted = str.replace(re, "$2");
document.write (quoted.split(' ').join('')+unquoted);
// -->
</SCRIPT>
alors quelle devrait être votre sortie? – ghostdog74