select SUBSTRING(schemat,'^(.+),') from tabela_schematy
Dane:
public,data
Wynik:
public
select SUBSTRING(schemat,'^(.+),') from tabela_schematy
Dane:
public,data
Wynik:
public
function initLinks() {
if (!document.getElementsByTagName) { return; }
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++){
var anchor = anchors[i];
if (anchor.getAttribute("href") && /^mapa_/i.test(anchor.id)) {
anchor.onclick = function () {
jakas_funkcja(this);
}
}
}
};
Sprawdzenie czy pierwszych 10 znaków numeru to cyfry:
var pole1 = document.form.numer;
var pval1 = pole1.value);
if(pval1.length>=10) {
var RegNumber=/([0-9]){10}/i;
var wynik1 = RegNumber.test(pval1);
}
if((wynik1==false) {
alert('ok');
b='numer';
a='blad';
}
if(a){
alert("UWAGA!"+a);
if(b)eval('document.form.'+b+'.focus()');
return false;
}
Usunięcie spacji
var pval1 = "600 600 600";
pval1 = pval1.replace(RegExp("\s+","g"),"");
Usunięcie więcej nich dwóch spacji
var pval2 = "500 500 500";
pval2 = pval2.replace(RegExp("\s{2,}","g")," ");
var tmp = null; var data =
'strona[ <a href="http://mapy.emiejsca.pl/egipt,egypt,miejsca.html">
http://mapy.emiejsca.pl/egipt,egypt,miejsca.html<a>
]';
var re = new RegExp(/strona\[(.*)\]/ig);
tmp=re.exec(data);
function deb_prop(tmp,ret) {
var obiekt_property = '';
for(j in tmp) obiekt_property += j + " "+ tmp[j] + "";
alert(obiekt_property);
}
alert(tmp[1]);
deb_prop(tmp);
W wyniku 2 alerty:
1:
---------------------------
Windows Internet Explorer
---------------------------
http://mapy.emiejsca.pl/egipt,egypt,miejsca.html
---------------------------
OK
---------------------------
2:
---------------------------
Windows Internet Explorer
---------------------------
input strona[ http://mapy.emiejsca.pl/egipt,egypt,miejsca.html ]
index 0
lastIndex 58
0 strona[ http://mapy.emiejsca.pl/egipt,egypt,miejsca.html ]
1 http://mapy.emiejsca.pl/egipt,egypt,miejsca.html
---------------------------
OK
---------------------------