On Fri, 2005-04-29 at 12:09 +0200, Lluís Batlle i Rossell wrote: > [EMAIL PROTECTED] ~/doc/xmligo/glosa $ echo "adela G" | \ > sed 's/^\([-A-FH-Za-z \?]\+\)/:\1:/' > :adela G: > [EMAIL PROTECTED] viric $ echo "adela G" | sed 's/^\([-A-FH-Za-z > \?]\+\)/:\1:/' > :adela :G > [EMAIL PROTECTED] ~ $ echo "adela G" | sed 's/^\([-A-FH-Za-z > \?]\+\)/:\1:/' > :adela :G > [EMAIL PROTECTED] viric $ echo "adela G" | sed 's/^\([-A-FH-Za-z > \?]\+\)/:\1:/' > :adela G: > My sed 4.1.4, in 'llimona', is the only one compiled with "nls" USE flag.
>From grep(1): > Within a bracket expression, a range expression consists of two charac- > ters separated by a hyphen. It matches any single character that sorts > between the two characters, inclusive, using the locale's > collating > sequence and character set. For example, in the default C locale, > [a-d] is equivalent to [abcd]. Many locales sort characters in dictio- > nary order, and in these locales [a-d] is typically not > equivalent to > [abcd]; it might be equivalent to [aBbCcDd], for example. To > obtain > the traditional interpretation of bracket expressions, you can use the > C locale by setting the LC_ALL environment variable to the value C. Your sed program should be: 's/^\([-ABCDEFHIJKLMNOPQRSTUVWXYZ[:lower:] \?]\+\)/:\1:/' -- gentoo-user@gentoo.org mailing list