vim或gcc的无法解释的行为

Dor*_*scu 2 c++ regex linux vim

我运行这个简单的程序:

#include <iostream>
#include <string>
using namespace std;

#include <boost/regex.hpp>

int main ()
{

//    boost::regex fullname_regex ("[A–Z]+[a–z]*, [A-Z][a–z]*");
boost::regex fullname_regex ("[A-Z]+[a-z]*, [A-Z][a-z]*");

string name;
cout << "Enter you full name: " << flush;

getline (cin, name);
if (! regex_match (name, fullname_regex))
{
    cout << "Error: name not entered correctly" << endl;
}

return 0;
}
Run Code Online (Sandbox Code Playgroud)

我刚从某处复制过的.当我取消注释注释行(原始复制/粘贴的一部分)并注释下一个(由我自己键入)时,程序始终拒绝该名称.否则它按预期工作.我正在使用vim.我确实:set list看到了隐藏的字符和线条相同.我在原始行之前插入一个长注释以便将其向下移动,怀疑是磁盘故障(非常旧的系统),但我仍然得到了相同的错误.这是一个没有gui的ubuntu服务器,我用putty来做这个.我不习惯linux下的这类问题,如果有人知道什么可以解释这种奇怪的行为,请告诉我.也许vim仍然使用原始页面中的一些选项,这是在这里并且格式化,确实,但:set list没有显示它们?

Luc*_*ner 6

破折号不一样.评论的那些更长并且由不同的字符表示,因此被不同地解释.常见复制+粘贴错误.

http://en.wikipedia.org/wiki/Dash