今天是7:00 TAGS: Mac,mac上的二笔输入法——续昨天的
Tuesday, April 24, 2007 5:02:55 AM
续昨天的。目前先用OpenVanilla的方式解决了。实现还是比较容易的,就是调用的速度太慢了,转换输入法以后还要等一段时间才能用上,不爽。
yue:~ yuelang$ date
二 4 24 12:59:34 CST 2007
Tuesday, April 24, 2007 5:02:55 AM
Monday, April 23, 2007 1:41:01 PM
Thursday, March 22, 2007 1:20:53 PM
让mac osx bash终端支持中文 一. bash终端显示中文 要显示中文,用 ls -w命令即可, 或者直接修改配置文件 vi /etc/profile 增加 alias ls='ls -w' 这样不用每次都敲选项-w ,这句放在/etc/bashrc 或者 /Users/Username/.profile 都可以. 二.让bash终端可以输入中文 vi /Users/USERNAME/.inputrc 添加如下内容并保存 set meta-flag on set convert-meta off set input-meta on set output-meta on vi /etc/profile 添加下列内容退出,(放在/Users/USERNAME/.profile 也一样) export LANG=zh_CN.UTF-8 这样,你的bash就可以显示和输入中文了. 三.在vi 编辑程序中输入中文 vi ~/.profile 增加下列alias 即可在vi 中输入utf8编码的中文 alias vi='env LC_CTYPE=zh_CN.UTF-8 vi' ps:如果还有问题,打开bash 选择 终端->窗口设置->仿真 不勾选 忽略ASCII字符
Friday, September 8, 2006 2:32:50 PM
Friday, September 1, 2006 2:09:27 PM
Friday, March 3, 2006 5:20:58 PM
Thursday, March 2, 2006 4:37:42 PM
Thursday, February 16, 2006 1:53:23 PM
在/application/installer中有一个xcode,装上就行了。。。。完全用不上fink。。。。现在想想 quicktime和zonzi说fink是垃圾真的是有一定原因的。。。。。。
Monday, February 13, 2006 2:41:51 AM
Can I run Gaim on MacOSX? Yes you can, but we do not provide a package for it. The reason being that in order to use Gaim on MacOSX, you need to install an X server and GTK+, which we are not prepared to support. You can either compile Gaim (and its dependencies) yourself, or you can use the fink installer available from http://fink.sf.net. If you would like a native aqua interface or a user-friendly installer, we suggest trying Adium.
gnutls on OS X Disclaimer: This is horribly boring, and probably interests .003% of the population. Tip: Information for other operating systems can be found at http://gaim.sourceforge.net/gaim-ssl.txt Since gaim now uses gnutls (or mozilla-nss, depending on who you talk to) to connect to MSN, and since I consider myself a pseudo-documentor of gaim, I thought I should see if I could get it up and running on OS X, specifically, Panther (10.3.1). Since I managed to get gnutls up and running with a little bit of a struggle, I thought I would document how I did it, to make life easier for the next poor bastard who might have to do the same thing. First, we're going to assume that you have fink up and running on your system. Installing fink is beyond the scope of this document, but it's fairly simple. Here is a list of packages that I had previously installed with fink. Will you need them all? Definitely not. However, you may need some of them. If you run into trouble, check with that list. First, you'll need to get the software. As of this writing, (11/25/2003) I used all the current versions of each piece of software. libgpg-error (needed by libgcrypt): ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/libgpg-error-0.6.tar.gz libgcrypt (needed by gnutls): ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/libgcrypt-1.1.90.tar.gz opencdk (needed by gnutls): ftp://ftp.gnutls.org/pub/gnutls/opencdk/opencdk-0.5.3.tar.gz gnutls (needed by gaim): ftp://ftp.gnutls.org/pub/gnutls/gnutls-0.9.91.tar.gz libgpg-error installed right out of the box. I simply did: $ ./configure --prefix=/sw $ make $ sudo make install It installed just fine. You'll notice I have the software install into /sw, where fink puts all of its stuff. I figured this was better than having it lie around in Panther's filesystem. libgcrypt required a configure script switch which I discovered on the gcrypt-devel mailing list. If you're having problems, there's more discussion there. $ ./configure --disable-asm --prefix=/sw $ make $ sudo make install If you forget to add that --disable-asm, you'll have a problem during make install, if I recall correctly. opencdk was the only real kludge job. For some reason it couldn't find malloc.h, so I had to sort of help it along. $ sudo cp /usr/include/malloc/malloc.h /sw/include/ $ ./configure --prefix=/sw $ make $ sudo make install I'm not sure why I had to move malloc.h, but once I did, it compiled. There seemed to still be some errors during compilation, but nothing that kept it from working. Or, as Anonymous notes below, you may want to try the following: $ CFLAGS="$CFLAGS -I/usr/include/malloc" ./configure --prefix=/sw $ make $ sudo make install I haven't tested that, but it's certainly less sloppy than actually copying the file. Next, onto gnutls itself. Once everything else was installed, it compiled just fine out of the box. $ ./configure --prefix=/sw $ make $ sudo make install The only "errors" that you're likely to notice during gnutls' configure sequence are the following: checking for asn1_read_tag in -ltasn1... no configure: WARNING: *** *** LibtASN1 0.2.x was not found. Will use the included one. checking whether to use the included minitasn1... yes checking whether to include zlib compression support... yes checking for compress in -lz... yes checking whether to use the included lzo compression library... no checking for lzo1x_1_compress in -llzo... no configure: WARNING: *** *** Liblzo was not found. Will use the included minilzo. I didn't bother installing these two extenal libraries, and you shouldn't have to either. But according to some reports, you definitely need opencdk, so don't skip out on that! gaim needed a little bit of coaxing to find the gnutls libraries. This step presumes you haven't had any problems compiling gaim already. Again, setting up X11, the X11 SDK, and just plain getting gaim to work on OS X are outside the scope of this document. Here's what I did to make it work: $ CFLAGS="-I/sw/include" LDFLAGS="-L/sw/lib" ./configure --prefix="/sw" --with-gnutls-libs=/sw/lib $ make $ sudo make install It might seem a bit excessive, (and maybe redundant) -- but it worked. Since I don't really -have- any MSN buddies, I haven't been able to test it out just yet, but I've been assured that connecting to MSN is proof enough. If you have any questions, feel free to email me at mike at alphamonkey.org, or instant message me at mikestyne (AIM) or mike at alphamonkey.org (MSN). I also usually hang out at Freenode, on #gaim. There, I'm mstyne. Posted: Tuesday, November 25th, 2003 at 07:34 EST [13 Comments on 'gnutls on OS X'] - [Comment on 'gnutls on OS X'] [Link to 'gnutls on OS X']
正则表达式介绍
随着对U N I X和L I N U X熟悉程度的不断加深,需要经常接触到正则表达式这个领域。使用
s h e l l时,从一个文件中抽取多于一个字符串将会很麻烦。例如,在一个文本中抽取一个词,
它的头两个字符是大写的,后面紧跟四个数字。如果不使用某种正则表达式,在s h e l l中将不
能实现这个操作。
本章内容包括:
• 匹配行首与行尾。
• 匹配数据集。
• 只匹配字母和数字。
• 匹配一定范围内的字符串集。
当从一个文件或命令输出中抽取或过滤文本时,可以使用正则表达式( R E),正则表达式
是一些特殊或不很特殊的字符串模式的集合。
为了抽取或获得信息,我们给出抽取操作应遵守的一些规则。这些规则由一些特殊字符
或进行模式匹配操作时使用的元字符组成。也可以使用规则字符作为模式中的一部分进行搜
寻。例如,A将查询A,x将查找字母x。
系统自带的所有大的文本过滤工具在某种模式下都支持正则表达式的使用,并且还包括
一些扩展的元字符集。这里只涉及其中之一,即以字符出现情况进行匹配的表达式,原因是
一些系统将这类模式划分为一组形成基本元字符的集合。这是一个好想法,本书也采用这种
方式。
本章设计的基本元字符使用在g r e p和s e d命令中,同时结合{ \ \ }(以字符出现情况进行匹配
的元字符)使用在a w k语言中。
表7-1 基本元字符集及其含义
^ 只只匹配行首
$ 只只匹配行尾
* 只一个单字符后紧跟*,匹配0个或多个此单字符
[ ] 只匹配[ ]内字符。可以是一个单字符,也可以是字符序列。可以使用-
表示[ ]内字符序列范围,如用[ 1 - 5 ]代替[ 1 2 3 4 5 ]
\ 只用来屏蔽一个元字符的特殊含义。因为有时在s h e l l中一些元字符有
特殊含义。\可以使其失去应有意义
. 只匹配任意单字符
p a t t e r n \ { n \ } 只用来匹配前面p a t t e r n出现次数。n为次数
p a t t e r n \ { n,\ } m 只含义同上,但次数最少为n
p a t t e r n \ { n,m \ } 只含义同上,但p a t t e r n出现次数在n与m之间
现在详细讲解其中特殊含义。
分文本过滤
使用句点匹配单字符
句点“.”可以匹配任意单字符。例如,如果要匹配一个字符串,以b e g开头,中间夹一个
任意字符,那么可以表示为b e g . n,“.”可以匹配字符串头,也可以是中间任意字符。
在ls -l命令中,可以匹配一定权限:
. . . x . . x . . x
此格式匹配用户本身,用户组及其他组成员的执行权限。
假定正在过滤一个文本文件,对于一个有1 0个字符的脚本集,要求前4个字符之后为X C,
匹配操作如下:
. . . .X C. . . .
以上例子解释为前4个字符任意,5,6字符为X C,后4个字符也任意,按下例运行:
注意,“.”允许匹配A S C I I集中任意字符,或为字母,或为数字。
在行首以^匹配字符串或字符序列
^只允许在一行的开始匹配字符或单词。例如,使用ls -l命令,并匹配目录。之所以可以
这样做是因为ls -l命令结果每行第一个字符是d,即代表一个目录。
回到脚本( 1),使用^ 0 0 1,结果将匹配每行开始为0 0 1的字符串或单词:
可以将各种模式结合使用,例如:
^ . . . 4 X C . . . .
结果为:
第二部分文本过滤
以上模式表示,在每行开始,匹配任意3个字符,后跟4 X C,最后为任意4个字符。^在正
则表达式中使用频繁,因为大量的抽取操作通常在行首。
在行首第4个字符为1,匹配操作表示为:
^ . . . 1
结果为:
行首前4个字符为c o m p,匹配操作表示为:
^ c o m p
假定重新定义匹配模式,行首前4个字符为c o m p,后面紧跟两个任意字符,并以i n g结尾,
一种方法为:
^ c o m p . . i n g
以上例子太明显了,不是很有用,但仍讲述了混合使用正则模式的基本概念。
在行尾以$匹配字符串或字符
可以说$与^正相反,它在行尾匹配字符串或字符, $符号放在匹配单词后。假定要匹配以
单词t r o u b l e结尾的所有行,操作为:
t r o u b l e $
类似的,使用1 d $返回每行以1 d结尾的所有字符串。
如果要匹配所有空行,执行以下操作:
^ $
具体分析为匹配行首,又匹配行尾,中间没有任何模式,因此为空行。
如果只返回包含一个字符的行,操作如下:
^ . $
不像空白行,在行首与行尾之间有一个模式,代表任意单字符。
如果在行尾匹配单词j e t 0 1,操作如下:
j e t 0 1 $
使用*匹配字符串中的单字符或其重复序列
使用此特殊字符匹配任意字符或字符串的重复多次表达式。例如:
c o m p u * t
将匹配字符u一次或多次:
另一个例子:
1 0 1 3 3 *
匹配
使用\屏蔽一个特殊字符的含义
有时需要查找一些字符或字符串,而它们包含了系统指定为特殊字符的一个字符。什么
是特殊字符?一般意义上讲,下列字符可以认为是特殊字符:
假定要匹配包含字符“ .”的各行而“,”代表匹配任意单字符的特殊字符,因此需要屏蔽
其含义。操作如下:
\ .
上述模式不认为反斜杠后面的字符是特殊字符,而是一个普通字符,即句点。
假定要匹配包含^的各行,将反斜杠放在它前面就可以屏蔽其特殊含义。如下:
\ ^
如果要在正则表达式中匹配以* . p a s结尾的所有文件,可做如下操作:
\ * \ . p a s
即可屏蔽字符*的特定含义。
使用[]匹配一个范围或集合
使用[ ]匹配特定字符串或字符串集,可以用逗号将括弧内要匹配的不同字符串分开,但并
不强制要求这样做(一些系统提倡在复杂的表达式中使用逗号),这样做可以增加模式的可读
性。
使用“ -”表示一个字符串范围,表明字符串范围从“ -”左边字符开始,到“ -”右边字
符结束。
如果熟知一个字符串匹配操作,应经常使用[ ]模式。
假定要匹配任意一个数字,可以使用:
[ 0 1 2 3 4 5 6 7 8 9 ]
然而,通过使用“-”符号可以简化操作:
[ 0 - 9 ]
或任意小写字母
[ a - z ]
要匹配任意字母,则使用:
[ A - Z a - z ]
表明从A - Z、a - z的字母范围。
如要匹配任意字母或数字,模式如下:
[ A - Z a - z 0 - 9 ]
在字符序列结合使用中,可以用[ ]指出字符范围。假定要匹配一单词,以s开头,中间有
一任意字母,以t结尾,那么操作如下:
s[a-z A-Z]t
上述过程返回大写或小写字母混合的单词,如仅匹配小写字母,可使用:
s [ a - z ] t
如要匹配C o m p u t e r或c o m p u t e r两个单词,可做如下操作:
[ C c ] o m p u t e r
为抽取诸如S c o u t、s h o u t、b o u g h t等单词,使用下列表达式:
[ou] .*t
匹配以字母o或u开头,后跟任意一个字符任意次,并以t结尾的任意字母。
也许要匹配所有包含s y s t e m后跟句点的所有单词,这里S可大写或小写。使用如下操作:
[ S,s ] y s t e m \ .
[ ]在指定模式匹配的范围或限制方面很有用。结合使用*与[ ]更是有益,例如[ A - Z a - Z ] *将
匹配所有单词。
[ A - Z a - z ] *
注意^符号的使用,当直接用在第一个括号里,意指否定或不匹配括号里内容。
[^a-zA-Z]
匹配任一非字母型字符,而
[ ^ 0 - 9 ]
匹配任一非数字型字符。
通过最后一个例子,应可猜知除了使用^,还有一些方法用来搜索任意一个特殊字符。
使用\{\}匹配模式结果出现的次数
使用*可匹配所有匹配结果任意次,但如果只要指定次数,就应使用\ { \ },此模式有三种
形式,即:
pattern\{n\} 匹配模式出现n次。
pattern\{n,\} 匹配模式出现最少n次。
pattern\{n,m} 匹配模式出现n到m次之间,n , m为0 - 2 5 5中任意整数。
请看第一个例子,匹配字母A出现两次,并以B结尾,操作如下:
A \ { 2 \ } B
匹配值为A A B
匹配A至少4次,使用:
A \ { 4 , \ } B
可以得结果A A A A B或A A A A A A A B,但不能为A A A B。
如给出出现次数范围,例如A出现2次到4次之间:
A \ { 2 , 4 \ } B
则结果为A A B、A A A B、A A A A B,而不是A B或A A A A A B等。
假定从下述列表中抽取代码:
格式如下:前4个字符是数字,接下来是x x,最后4个也是数字,操作如下:
[ 0 - 9 ] \ { 4 \ }X X[ 0 - 9 ] \ { 4 \ }
具体含义如下:
1) 匹配数字出现4次。
2) 后跟代码x x。
3) 最后是数字出现4次。
结果为:
在写正则表达式时,可能会有点难度或达不到预期效果,一个好习惯是在写真正的正则
表达式前先写下预期的输出结果。这样做,当写错时,可以逐渐修改,以消除意外结果,直
至返回正确值。为节省设计基本模式的时间,表7 - 2给出一些例子,这些例子并无特别顺序。
表7-2 经常使用的正则表达式举例
^ 对行首
$ 对行尾
^ [ t h e ] 对以t h e开头行
[ S s ] i g n a [ l L ] 对匹配单词s i g n a l、s i g n a L、
S i g n a l、S i g n a L
[Ss]igna[lL]\. 对同上,但加一句点
[ m a y M A Y ] 对包含m a y大写或小写字母的
行
^ U S E R $ 对只包含U S E R的行
[tty]$ 对以t t y结尾的行
\ . 对带句点的行
^ d . . x . . x . . x 对对用户、用户组及其他用户
组成员有可执行权限的目录
^ [ ^ l ] 对排除关联目录的目录列表
[ . * 0 ] 对0之前或之后加任意字符
[ 0 0 0 * ] 对0 0 0或更多个
[ iI] 对大写或小写I
[ i I ] [ n N ] 对大写或小写i或n
[ ^ $ ] 对空行
[ ^ . * $ ] 对匹配行中任意字符串
^ . . . . . . $ 对包括6个字符的行
[a- zA-Z] 对任意单字符
[ a - z ] [ a - z ] * 对至少一个小写字母
[ ^ 0 - 9 \ $ ] 对非数字或美元标识
[ ^ 0 - 0 A - Z a - z ] 对非数字或字母
[ 1 2 3 ] 对1到3中一个数字
[ D d ] e v i c e 对单词d e v i c e或D e v i c e
D e . . c e 对前两个字母为D e,后跟两个
任意字符,最后为c e
\ ^ q 对以^ q开始行
^ . $ 对仅有一个字符的行
^\.[0-9][0-9] 对以一个句点和两个数字开始
的行
' " D e v i c e " ' 对单词d e v i c e
D e [ V v ] i c e \ . 对单词D e v i c e或d e v i c e
[ 0 - 9 ] \ { 2 \ } - [ 0 - 9 ] \ { 2 \ } - [ 0 - 9 ] \ { 4 \ } 对日期格式d d - m m - y y y y
[ 0 - 9 ] \ { 3 \ } \ . [ 0 - 9 ] \ { 3 \ } \ . [ 0 - 9 ] \ { 3 \ } \ . [ 0 - 9 ] \ { 3 \ } 对I P地址格式nnn. nnn.nnn.nnn
[ ^ . * $ ] 对匹配任意行
小结
在s h e l l编程中,一段好的脚本与完美的脚本间的差别之一,就是要熟知正则表达式并学
会使用它们。相比较起来,用一个命令抽取一段文本比用三四个命令得出同样的结果要节省
许多时间。
既然已经学会了正则表达式中经常使用的基本特殊字符,又通过一些例子简化了其复杂
操作,那么现在可以看一些真正的例程了。
正则表达式语法
一个正则表达式就是由普通字符(例如字符 a 到 z)以及特殊字符(称为元字符)组成的文字模式。该模式描
述在查找文字主体时待匹配的一个或多个字符串。正则表达式作为一个模板,将某个字符模式与所搜索的字符
串进行匹配。
\
将下一个字符标记为一个特殊字符、或一个原义字符、或一个 后向引用、或一个八进制转义符。例如,'n' 匹
配字符 "n"。'\n' 匹配一个换行符。序列 '\\' 匹配 "\" 而 "\(" 则匹配 "("。
^
匹配输入字符串的开始位置。
$
匹配输入字符串的结束位置。
*
匹配前面的子表达式零次或多次。例如,zo* 能匹配 "z" 以及 "zoo"。 * 等价于{0,}。
+
匹配前面的子表达式一次或多次。例如,'zo+' 能匹配 "zo" 以及 "zoo",但不能匹配 "z"。+ 等价于 {1,}。
?
匹配前面的子表达式零次或一次。例如,"do(es)?" 可以匹配 "do" 或 "does" 中的"do" 。? 等价于 {0,1}。
{n}
n 是一个非负整数。匹配确定的 n 次。例如,'o{2}' 不能匹配 "Bob" 中的 'o',但是能匹配 "food" 中的两个 o。
{n,}
n 是一个非负整数。至少匹配n 次。例如,'o{2,}' 不能匹配 "Bob" 中的 'o',但能匹配 "foooood" 中的所有 o。'o{1,}' 等价于 'o+'。'o{0,}' 则等价于 'o*'。
{n,m}
m 和 n 均为非负整数,其中n <= m。最少匹配 n 次且最多匹配 m 次。 "o{1,3}" 将匹配 "fooooood" 中的前三个 o。'o{0,1}' 等价于 'o?'。请注意在逗号和两个数之间不能有空格。
?
当该字符紧跟在任何一个其他限制符 (*, +, ?, {n}, {n,}, {n,m}) 后面时,匹配模式是非贪婪的。非贪婪模式尽可
能少的匹配所搜索的字符串,而默认的贪婪模式则尽可能多的匹配所搜索的字符串。例如,对于字符串 "oooo",'o+?' 将匹配单个 "o",而 'o+' 将匹配所有 'o'。
.
匹配除 "\n" 之外的任何单个字符。要匹配包括 '\n' 在内的任何字符,请使用象 '[.\n]' 的模式。
(pattern)
匹配pattern 并获取这一匹配。所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches
集合,在Visual Basic Scripting Edition 中则使用 $0…$9 属性。要匹配圆括号字符,请使用 '\(' 或 '\)'。
(?:pattern)
匹配 pattern 但不获取匹配结果,也就是说这是一个非获取匹配,不进行存储供以后使用。这在使用 "或" 字
符 (|) 来组合一个模式的各个部分是很有用。例如, 'industr(?:y|ies) 就是一个比 'industry|industries' 更简略
的表达式。
(?=pattern)
正向预查,在任何匹配 pattern 的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不
需要获取供以后使用。例如, 'Windows (?=95|98|NT|2000)' 能匹配 "Windows 2000" 中的 "Windows" ,但不能匹配
"Windows 3.1" 中的 "Windows"。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开
始下一次匹配的搜索,而不是从包含预查的字符之后开始。
(?!pattern)
负向预查,在任何不匹配Negative lookahead matches the search string at any point where a string not
matching pattern 的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不需要获取供以
后使用。例如'Windows (?!95|98|NT|2000)' 能匹配 "Windows 3.1" 中的 "Windows",但不能匹配 "Windows 2000" 中
的 "Windows"。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的
搜索,而不是从包含预查的字符之后开始
x|y
匹配 x 或 y。例如,'z|food' 能匹配 "z" 或 "food"。'(z|f)ood' 则匹配 "zood" 或 "food"。
[xyz]
字符集合。匹配所包含的任意一个字符。例如, '[abc]' 可以匹配 "plain" 中的 'a'。
[^xyz]
负值字符集合。匹配未包含的任意字符。例如, '[^abc]' 可以匹配 "plain" 中的'p'。
[a-z]
字符范围。匹配指定范围内的任意字符。例如,'[a-z]' 可以匹配 'a' 到 'z' 范围内的任意小写字母字符。
[^a-z]
负值字符范围。匹配任何不在指定范围内的任意字符。例如,'[^a-z]' 可以匹配任何不在 'a' 到 'z' 范围内的任意
字符。
\b
匹配一个单词边界,也就是指单词和空格间的位置。例如, 'er\b' 可以匹配"never" 中的 'er',但不能匹配
"verb" 中的 'er'。
\B
匹配非单词边界。'er\B' 能匹配 "verb" 中的 'er',但不能匹配 "never" 中的 'er'。
\cx
匹配由x指明的控制字符。例如, \cM 匹配一个 Control-M 或回车符。 x 的值必须为 A-Z 或 a-z 之一。否则,将
c 视为一个原义的 'c' 字符。
\d
匹配一个数字字符。等价于 [0-9]。
\D
匹配一个非数字字符。等价于 [^0-9]。
\f
匹配一个换页符。等价于 \x0c 和 \cL。
\n
匹配一个换行符。等价于 \x0a 和 \cJ。
\r
匹配一个回车符。等价于 \x0d 和 \cM。
\s
匹配任何空白字符,包括空格、制表符、换页符等等。等价于 [ \f\n\r\t\v]。
\S
匹配任何非空白字符。等价于 [^ \f\n\r\t\v]。
\t
匹配一个制表符。等价于 \x09 和 \cI。
\v
匹配一个垂直制表符。等价于 \x0b 和 \cK。
\w
匹配包括下划线的任何单词字符。等价于'[A-Za-z0-9_]'。
\W
匹配任何非单词字符。等价于 '[^A-Za-z0-9_]'。
\xn
匹配 n,其中 n 为十六进制转义值。十六进制转义值必须为确定的两个数字长。例如, '\x41' 匹配 "A"。
'\x041' 则等价于 '\x04' & "1"。正则表达式中可以使用 ASCII 编码。.
\num
匹配 num,其中 num 是一个正整数。对所获取的匹配的引用。例如,'(.)\1' 匹配两个连续的相同字符。
\n
标识一个八进制转义值或一个后向引用。如果 \n 之前至少 n 个获取的子表达式,则 n 为后向引用。否则,如
果 n 为八进制数字 (0-7),则 n 为一个八进制转义值。
\nm
标识一个八进制转义值或一个后向引用。如果 \nm 之前至少有is preceded by at least nm 个获取得子表达式,
则 nm 为后向引用。如果 \nm 之前至少有 n 个获取,则 n 为一个后跟文字 m 的后向引用。如果前面的条件都不
满足,若 n 和 m 均为八进制数字 (0-7),则 \nm 将匹配八进制转义值 nm。
\nml
如果 n 为八进制数字 (0-3),且 m 和 l 均为八进制数字 (0-7),则匹配八进制转义值 nml。
\un
匹配 n,其中 n 是一个用四个十六进制数字表示的 Unicode 字符。例如, \u00A9 匹配版权符号 (?)。
Saturday, February 11, 2006 2:57:20 AM
关于声音: How do I get sound to work correctly? Gaim uses libao to play sounds. Playing sounds directly through esound or arts is no longer supported. " Libao is a cross-platform library that allows programs to output PCM audio data to the native audio devices on a wide variety of platforms. It currently supports OSS (Open Sound System), ESD (ESounD), ALSA (Advanced Linux Sound Architecture), Sun audio system (used in Solaris, OpenBSD, and NetBSD), aRts (Analog Realtime Synthesizer). " To compile Gaim with support for libao you need libao-devel and audiofile-devel. To use libao you need libao and audiofile. If you do not wish to install these packages you can also just change your sound playing method in preferences to Command and use esdplay %s or artsplay %s. How do I make Gaim use ALSA or OSS for playing sounds? What does the "Automatic" option do? If you choose "Automatic", "ESD", or "Arts", Gaim uses libao to play sounds. Choosing "ESD" or "Arts" forces libao to play sounds using that method, while choosing "Automatic" lets it decide for itself. If you choose "Automatic", you can create a file, either /etc/libao.conf or ~/.libao, and put one of the following lines in it: default_driver=alsa default_driver=oss Other drivers, like alsa09, arts, esd, irix, macosx, nas, and sun might also be supported, depending on your platform and how libao was compiled. See also man 5 libao.conf. 来自于:http://gaim.sourceforge.net/faq.php#q19
关于ssl: Ubuntu (Warty 4.10 & Hoary 5.04) If you want to compile from source, make sure you have libgnutls10-dev installed. Lars-Erik Labori provided a nice easy to follow guide: First of all, you need to remove the old ubuntu Gaim version: $ sudo apt-get remove gaim 1. You need to download the latest Gaim source from here. 2. You need to install the GNU TLS library development files: $ sudo apt-get install libgnutls10-dev 3. Compile Gaim: $ ./configure --enable-gnutls=yes $ sudo make $ sudo make install Your new Gaim should be up and running. 或: Debian Use the debs If you want to compile from source, make sure you have libgnutls11-dev installed. You can ensure you have all the necessary build dependencies installed by running: apt-get build-dep gaim. Note: libgnutls & libgnutls-dev (from woody) are known to NOT work 来自于:http://gaim.sourceforge.net/faq-ssl.php
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | |||