Mình có đoạn string sau cần regex bằng c#:
//<![CDATA[
(function(){
var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },
b = function(b, c) {a() ? document.addEventListener("DOMContentLoaded", b, c) : document.attachEvent("onreadystatechange", b)};
b(function(){
var a = document.getElementById('cf-content');a.style.display = 'block';
setTimeout(function(){
var s,t,o,p,b,r,e,a,k,i,n,g,f, WrxdrAA={"jKh":+((!+[]+!![]+[])+(+[]))};
t = document.createElement('div');
t.innerHTML="<a href='/'>x</a>";
t = t.firstChild.href;r = t.match(/https?:\/\//)[0];
t = t.substr(r.length); t = t.substr(0,t.length-1);
a = document.getElementById('jschl-answer');
f = document.getElementById('challenge-form');
;WrxdrAA.jKh-=+((!+[]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]));WrxdrAA.jKh*=+((+!![]+[])+(!+[]+!![]+!![]+!![]));WrxdrAA.jKh+=+((!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]));WrxdrAA.jKh+=+((+!![]+[])+(!+[]+!![]+!![]+!![]+!![]));WrxdrAA.jKh-=+((!+[]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]));WrxdrAA.jKh+=!+[]+!![]+!![]+!![]+!![]+!![];WrxdrAA.jKh+=+((+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]));a.value = parseInt(WrxdrAA.jKh, 10) + t.length; '; 121'
f.submit();
}, 4000);
}, false);
})();
//]]>
Chuỗi cần lấy sau khi regex:
var s,t,o,p,b,r,e,a,k,i,n,g,f, WrxdrAA={"jKh":+((!+[]+!![]+[])+(+[]))};
t='demo',a='demo'
WrxdrAA.jKh-=+((!+[]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]));WrxdrAA.jKh*=+((+!![]+[])+(!+[]+!![]+!![]+!![]));WrxdrAA.jKh+=+((!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]));WrxdrAA.jKh+=+((+!![]+[])+(!+[]+!![]+!![]+!![]+!![]));WrxdrAA.jKh-=+((!+[]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]));WrxdrAA.jKh+=!+[]+!![]+!![]+!![]+!![]+!![];WrxdrAA.jKh+=+((+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]));a.value = parseInt(WrxdrAA.jKh, 10) + t.length;