Adriano Allora wrote: > b) to transform > s/-+/-/g; > s/\*+/\*/g; > s/\^+/\^/g; > s/\_+/\_/g; > s/ +/ /g; (this one doesn't works very well: at the end there are > several blank spaces) > > and I used this one: s/\s+/ /g; but I understand this is not very > useful: I need to change a multiple \n|\r|\t|\f in a single \n|\r|\t|\f. >
Or more general, you want to substitute more occurences of -, *, ^, _, \s with only one. To implement this, you can use first a character class and second a capture: s/([*^_\s-])+/$1/g; Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]