var testStr = "Lorem ipsum 'vendor/js/srcipt.js' dolor sit amet, 'lib/ls/jquery/jquery.min.js' consectetur 'img/pict.jpg' adipisicing 'vendor/style/some-style.min.css' 'vendor/style/some-style.less' или 'vendor/img/bla.png' elit. Adipisci, tenetur?";
var reqExpWrapper = new RegExp('(?:vendor/)((?:.*?)\\.(?:css|js))\'', 'g');
var matches = new Array();
while(match = reqExpWrapper.exec(testStr))
{
matches.push(match[1]);
}
console.log(matches);
$sourceContent = '<div style="margin-top: -18px;">
<nobr>
<b>18 / 25</b>
</nobr>
</div>';
$regExpWrapper = "#(?:<nobr>(?:.*)(?:<b>))(.*?)/(.*?)(?:</b>)#s";
preg_match($regExpWrapper, $sourceContent, $matches);
echo iconv("UTF-8", "CP866", $matches[1]." из ".$matches[2]);
$regExpWrapper = "#(?:\"wa-progress\")(?:.*?)(?:</div>(?:.*?)>(.*?)/(.*?)</div>)#s";
$cURL = curl_init();
curl_setopt ($cURL, CURLOPT_URL,'www.goldcs.ru');
curl_setopt ($cURL, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($cURL, CURLOPT_SSL_VERIFYPEER, 0);
$cURLResult = curl_exec($cURL);
curl_close($cURL);
preg_match($regExpWrapper, $cURLResult, $matches);
echo iconv("UTF-8", "CP866", $matches[1]." из ".$matches[2]);
var ipaddress = '127.0.0.1';
var port = 9000;
function testWebSocketServerAndNotification()
{
var WebSocketServer = require('ws').Server;
var path = require('path');
var notifier = require('node-notifier');
var message = 'Hello from Node.js';
var path2Image = 'e:\\MyWork\\NodeWorkBench\\TestApp\\image\\infoBalloon.png';
var wss = new WebSocketServer({host:ipaddress, port:port});
wss.broadcast = function(data)
{
for (var i in this.clients)
{
this.clients[i].send(data);
}
};
wss.on('connection', function(ws)
{
ws.on('message', function(message)
{
wss.broadcast(message);
notifier.notify
({
title: 'My notification',
message: `Message: '${message}'`,
sound: true,
time: 5000,
wait: true,
icon: path.join(__dirname, 'image', 'notificationIcon.png'),
contentImage: path2Image,
});
});
});
console.log('Слушаем адрес ' + ipaddress + ' на порте: ' + port + ' ...');
}
<?php
require_once "e:\\MyWork\\web\\Script\\PHP\\PHP_SocketIO_Client\\socket.io.php";
$socketio = new SocketIO();
echo iconv("UTF-8", "CP866", "exit для выхода\n");
while(true)
{
$input = fgets(STDIN);
if(trim($input) == "exit")
{
break;
}
if ($socketio->send("127.0.0.1", 9000, iconv("CP866", "UTF-8", trim($input))))
{
echo iconv("UTF-8", "CP866", "Сообщение отправлено. Можете продолжать:\n");
} else
{
echo iconv("UTF-8", "CP866", "Какой-то сбой :(\n");
}
}
exit("Jobe done");
?>
testStr = 'http://name.ru/name?date=01%2F15%2F2016&count-people=45';
regExpWrapper = new RegExp('(?:date=)(.*?)&(?:.*)=(.*)$');
result = regExpWrapper.exec(decodeURIComponent(testStr));
console.log(result[2] + '. ' + result[1]);
$string = 'text: texttext;text;var=abc';//'text: texttext;text;var=abc;text';
$regExpWrapper = "/(?:var=)(.*?)(?:;|$)/";
preg_match($regExpWrapper, $string, $matches);
print_r($matches);
хочу приделать scrollspy, но банально не взять кликне понятно. Что вы хотите сделать?
downloadItem = chrome.contextMenus.create
(
{
id: "utilsExtDownloadMenuItem",
parentId: rootItem,
title: "Загрузить...",
contexts: ["all"],
onclick: downloadContent
},
function(){}
);
........
function downloadContent(info, tab)
{
........
}