全字匹配的正则表达式怎么写?
-
- 帖子: 241
- 注册时间: 2008-05-25 20:35
全字匹配的正则表达式怎么写?
就是想匹配
this is cool
里的cool
而不匹配
this is cooler
还有,匹配中文的正则表达式怎么写?
谢谢
this is cool
里的cool
而不匹配
this is cooler
还有,匹配中文的正则表达式怎么写?
谢谢
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re: 全字匹配的正则表达式怎么写?
cool\bcrossie 写了:就是想匹配
this is cool
里的cool
而不匹配
this is cooler
还有,匹配中文的正则表达式怎么写?
谢谢
中文的话[^[:print:]]
喔喔 刚刚实验了下
要加LANG=zh_CN.gbk
或是LANG=C
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
要是中文里面正好碰到回车怎么办?这个问题很诡异,刚刚看了下中文的正则。建议不要做中文正则式的替换之类的操作,可能会乱码。我是说和shell里面命令所使用的正则库有关
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
- greco
- 帖子: 2487
- 注册时间: 2007-04-06 10:24
- 来自: ~/Shanghai
(?:^|\b)YourKeyWord(?:^|\b)
http://silenceisdefeat.com/~greco
代码: 全选
''.join([chr(ord(c)-2) for c in 'O{"G/ockn"ku<"itgeq0ujkBiockn0eqo'])
echo -n "Z3JlY28uc2hpQGdtYWlsLmNvbQ==" | base64 -d