This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: awk gsub problem


On 2010-09-19 20:33Z, Lee wrote:
>
[...awk character ranges are locale-sensitive...]
> 
> Was the reply from the upstream maintainer answered on a mailing list?
>  (& if so, which one?)  I'd like to understand the problem they're
> solving..  I get the idea of "[[:lower:]]" working regardless of
> collating order of the current char set, but how "[a-z]" gets
> translated to something like "[aAbBcCdD...zZ]" boggles my mind.  It
> seems like they had to have gone out of their way to translate [a-z]
> into a case-insensitive RE.

Discussed here:
  http://www.gnu.org/manual/gawk/html_node/Character-Lists.html#Character-Lists

And here's the same 'aAbBcC' question for 'ls' on solaris:
  http://groups.google.com/group/comp.unix.solaris/browse_thread/thread/8526e1b6eb18fb31/
It's not specific to gawk.

>    --traditional
>       Traditional Unix awk regular expressions are matched.  The GNU
> operators are not special, interval expressions are not available, and
> neither are the POSIX character classes ([[:alnum:]] and so on).

That option doesn't override the locale; to do that, see:
  http://www.gnu.org/manual/gawk/html_node/Locales.html#Locales

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]