Results 1 to 9 of 9
Hello all,
I read somewher that regular expressions work with ASCII table so when i type
Code:
grep "[a-z][a-z]*" file_name
it uses values from ACII dec97(a) to dec122(z), right ?
...
- 10-13-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
regular expressions and foregin language
Hello all,
I read somewher that regular expressions work with ASCII table so when i type
it uses values from ACII dec97(a) to dec122(z), right ?Code:grep "[a-z][a-z]*" file_name
But if I have file containing diacritics, lets say (ordinary Slovak language characters):
Why this regexp know diacritics? And why know only lower case and not "ž" ??? This is strange for me. Friend told me it could be something with $LANG. So my $LANG is:Code:marek@cepi:~$ cat diakritika áôúéťľúľščťžýáíéôäúú ÁôúÉŤĽÚĽŠČŤŽÝÁÍÉôäÚÚ marek@cepi:~$ grep -o "[a-z][a-z]*" diakritika áôúéťľúľščť ýáíéôäúú ôú ôä
Also I would ask if I want uppercase file with diacritic i type:Code:marek@cepi:~$ echo $LANG en_US.UTF-8
why it not change lower to upper ?Code:marek@cepi:~$ cat diakritika | tr "[:lower:]" "[:upper:]" áôúéťľúľščťžýáíéôäúú ÁôúÉŤĽÚĽŠČŤŽÝÁÍÉôäÚÚ
Thanks a lot for reply
PS: I hope that characters display properly
- 10-15-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,499
You probably need to change your LOCALE which I think you can do by setting the LANG environment variable as you may have surmised. Upper/Lower case issues are language specific so you need to change the locale to the language you are interested in. To see what languages are compiled into your system execute the command "locale -a". To see what your current locale information is just execute the command "locale".
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-17-2009 #3Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
hi. probably I know why is "ž" different.... it is "behind" "z" and so it did not match to regexp [a-z]
I issued command locale -a
and localeCode:C en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8 en_IN en_NG en_NZ.utf8 en_PH.utf8 en_SG.utf8 en_US.utf8 en_ZA.utf8 en_ZW.utf8 POSIX
I saw that I have not Slovak language in locale -a. Could that be reason why I have strange ID3s characters in slovak music in my Rhytmbox on xubuntu ? And how can I fix this problem and how can I install slovak language ? Thank you so mouchCode:LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
- 10-18-2009 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,499
I'm not sure which locale code is for Slovakian. I have a lot more locales installed on my system. What distribution+version of Linux are you running? In Red Hat systems, I think the extra locales are installed with the mono-locale-extras package, but I'm not certain about that. The only locales I am personally interested in are English and Spanish for the most part.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-18-2009 #5Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
Hi I am runung xubuntu
cat /boot/grub/menu.lst | grep title
title Ubuntu 9.04, kernel 2.6.28-15-generic
cat /proc/version
Linux version 2.6.28-14-generic (buildd@palmer) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #47-Ubuntu SMP Sat Jul 25 00:28:35 UTC 2009
Could be reason of missing locale that some programs that display slovak language have problems with characters ?
- 10-19-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,499
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-20-2009 #7Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
Thanks
, can you please explain how to instale locale database to xubuntu ? on internet i found just something about oracle
- 10-27-2009 #8Just Joined!
- Join Date
- Jul 2009
- Posts
- 49
nobody ?
Someone please post tutorial or something, the more I read the less I know, and my knowledge about languages in linux is very poor
- 10-27-2009 #9Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,499
You should be able to get the locale repository from the Ubuntu web site. Then, you may need to compile the ones you want - the locale tool will do that for you once you have the repository.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote

