[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Collating characters?
From: |
Aharon Robbins |
Subject: |
Re: Collating characters? |
Date: |
Mon, 6 Dec 2004 10:06:46 +0200 |
Greetings. Re this:
> Date: Sun, 05 Dec 2004 19:33:50 -0800
> From: Art Hixson <address@hidden>
> To: address@hidden
> Subject: Collating characters?
>
> I'm just trying out gawk for the first time. Forgive me if I'm missing
> something. I'm running on XP (darn it).
Native, or using cygwin?
> I'm trying to use the construction /[[.70.]]/ to treat this character
> pair as a unit. However, contrary to the documentation, it gives :
>
> *gawk: prg.txt:7: fatal: Invalid collation character: /[[.70.]]/*
>
> when I try just /[.70.]/ I get all the 7s and 0s in any order , i.e.,
> ORed., which is just a character list.
>
> Where have I gone astray? (leaving out my personal life as that would
> take too many pages)
>
> --Art
I have to admit to having no experience with collating characters.
That said, I'll convey my understanding of them.
You cannot use [. and .] to group an arbitrary pair of characters
together. Collating characters are defined by the locale in which
you're running, and only those defined by the locale are available for
use inside [. and .]. They usually have names, defined by the
locale; the name may or may not be the actual sequence of characters,
such [.ch.].
If all you want is to match lines where 7 is immediately followed by 0,
then just use
gawk '/70/ { ... }'
Hope this helps,
Arnold
- Re: Collating characters?,
Aharon Robbins <=