我试图从文本文件中取出日期.这是内容:
Storage Manager命令行管理界面 - 版本7,版本1,级别1.4(c)版权所有,公司和其他(1990),2015.保留所有权利.
与服务器TSERVER建立的会话:Windows Server版本7,版本1,级别5.200服务器日期/时间:11/22/2016 15:30:00最后访问:11/22/2016 15:25:00
ANS8000I服务器命令.
我需要在服务器日期/时间之后提取日期/时间.我写了这个正则表达式:
/([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})/
Run Code Online (Sandbox Code Playgroud)
这在regex101中完美运行.请参阅https://regex101.com/r/MB7yB4/1上的示例 但是,在Powershell中它的反应不同.
$var -match "([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})"
Run Code Online (Sandbox Code Playgroud)
给
服务器日期/时间:11/22/2016 16:30:00最后访问:2016年11月22日15:37:19
和
$var -match "([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})"
Run Code Online (Sandbox Code Playgroud)
什么都没有.
我不确定为什么比赛不一样.
谢谢你的帮助!
我正在尝试检查cURL的输出。
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://blablabla.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$curlresult=curl_exec ($ch);
curl_close ($ch);
if ($curlresult == "OK") {
$result = "The curl action was succeeded! (OUTPUT of curl is: ".$curlresult.")";
} else {
$result = "The curl action has FAILED! (OUTPUT of curl is: ".$curlresult.")";
}
echo $result;
?>
Run Code Online (Sandbox Code Playgroud)
URL(https://blablabla.com)是仅显示OK的URL。因此,使用代码,我希望看到
“卷曲动作成功了!(卷曲的输出是:OK)”
但是,我得到的是:
卷曲动作失败!(卷曲的输出是:OK)
我想我在犯一些愚蠢的错误。如何检查https://blablabla.com是否包含“确定”?
谢谢!
我正在尝试将值从html页面传递给JS文件.
HTML部分:
<a href="#" id="pagejs_general_delete_wizardresultid"><i class=" icon-bin" ></i> Delete</a>
Run Code Online (Sandbox Code Playgroud)
JS档案:
$('#pagejs_general_delete_wizardresultid').on('click', function() {
swal({
title: "Are you sure?",
text: "Are you sure you want to delete item with reference <wizardresultid here>? This can not be undone!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#EF5350",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel!",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm, wizardresultid){
if (isConfirm) {
swal({
title: "Deleted!",
text: "The record has been deleted.",
confirmButtonColor: "#66BB6A",
type: "success"
});
}
else {
swal({
title: "Cancelled",
text: …Run Code Online (Sandbox Code Playgroud)