On 2005-04-29 12:09:48 +0200 (Fri, Apr), Lluís Batlle i Rossell wrote:
> Hi!
> 
> I need to use a regexp in sed for parsing a file... and I found a wrong
> behaviour. I've tried in some computers, and I've found -DIFFERENT- 
> behaviours.
> 
> It works -wrong- to me, in sed 4.0.9 and sed 4.1.4.
> Here is the result in different computers:
> 
> [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:
[...]
> Any help?

man regex:
 Ranges  are  very collating-sequence-dependent, and portable programs
 should avoid relying on them.

What are the locale settings on these computers? LC_ALL, LANG ?

Try the same test with export LC_ALL=C; echo "adela G" | sed ....
Maybe it will help.
(or rewrite the regexp to NOT use ranges)

-- 
$ ls -lart
/bin/ls: you must be root to use LART

Attachment: pgpV2bdi6HJwr.pgp
Description: PGP signature

Reply via email to