我需要有关 C++ 代码的帮助。
我想搜索一个文件并逐行读取它,如果电话号码的父级匹配,它必须将该行打印到另一个文件中。
我能够匹配字符串但不确定:如何匹配电话号码的格式/模式电话号码可以不同。我只想遵循电话号码匹配的格式。
Number 的示例可以是 xx-xxx-xxxx
这是我的代码看看
// reading a text file
if (mywritingfile.is_open())
{
//Getting data line from file.
while ( getline (myfile,line) )
{
if (Match the Pattren from the line)//Need Help Here.
{
//Printing the Mached line Content Of the source File to the destination the File.
//Output Every line that it fetches
cout << line << endl;
mywritingfile << line << endl;
matches++;
}
}
}
Run Code Online (Sandbox Code Playgroud) 我需要一些关于如何使用 Javascript 访问 JSON 对象的密钥的指导:"yweather:forecast"
。我尝试过json.yweather:forecast
,但它抛出一个错误。
{
"yweather:forecast" : [
{
"@day":"Wed",
"@date":"10 Jul 2013",
"@low":"75"
}
]
}
Run Code Online (Sandbox Code Playgroud)