Torsten,
=20
I'm not sure it is any better because it is certainly more complicated,
but here is another regex that would remove similar expressions from an
input stream.=20
=20
sed 's/\([ ,]\)user[,]*/\1/g ; s/,\([ $]*\)/\1/g'
=20
The first expression removes either leading "user" options or embedded
ones within a string and the latter one removes a trailing comma remnant
from a ",user" at the end of an options string (it also checks for and
preserves trailing blanks, not just end of line). If you don't care
about trailing blanks etc. the latter expression reduces easily to
"s/,$//" giving:
=20
sed 's/\([ ,]\)user[,]*/\1/g ; s/,$//'
=20
=20
Peter Roeser
=20
|