惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - niuke

VMware Server Beta Virtual Server 2005 vs Windows Server 2003 Sp1 IIS中的站点操作员 WSS中文站点模板 WSS站点迁移时需要注意用户SID的问题 SPS安装过程中的小故障 Command line - niuke - 博客园 Netcap 目前的工作 走独立自主的路线 About Windows server 2003 _msdcs zone 关于SSL、TSL和WTLS原理 留神Vmware的VMnet8 NAT服务 Windows Server 2003中使用AT + Shutdown不能正确运行 关于Windows DHCP Server的几点说明 上班了! 关闭Windows XP的Local Machine Zone Lockdown 等待上班 Longhorn的官方发布时间
一个不工作的Regular Expression
niuke · 2004-09-16 · via 博客园 - niuke

今天在看一本.Net的书,一边做着书上的code samples。为了省事儿有些很长的代码就直接从电子书上拷贝过来粘贴到编辑器里面,但是有一段代码中的regular expression就是不工作。仔细瞧了一遍,也看不出什么问题,没办法只好手动输入试试,结果就正常了。于是上下的细细比较了一番,才发现原来这段regular expression中的管道符号是“│”而非“|”。写了段测试看看

Console.WriteLine(
    System.Text.ASCIIEncoding.ASCII.GetBytes(
"|")[0]);
Console.WriteLine(
    System.Text.ASCIIEncoding.ASCII.GetBytes(
" |")[0]);

原来在英文电子书中的管道符号“│”ASCII内码是63,而在我们从键盘上输入的“|”ASCII内码是124。其实我知道ASCII中63是问号(?),看来这是一个双字节的符号。于是取来Unicode内码一看原来是“\u2502”.

在英文书的字体下面两个符号几乎宽度一模一样,真是肉眼很难分辨呀!