Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
var eingabe = prompt ('Eingabe');
var regexp = /[^A-z0-9_\-] /
if (regexp.test (eingabe)
{
alert ('Ja')
}
else {alert ('Nein')}
'integer': {
characterMasking: /[\-\+\d]/,
regExpFilter: /^[\-\+]?\d*$/,
validation: function(value, options) {
if (value == '' || value == '-' || value == '+') {
return false;
}
var regExp = /^[\-\+]?\d*$/;
if (!regExp.test(value)) {
return false;
}
options = options || {allowNegative:false};
var ret = parseInt(value, 10);
if (!isNaN(ret)) {
var allowNegative = true;
if (typeof options.allowNegative != 'undefined' && options.allowNegative == false) {
allowNegative = false;
}
if (!allowNegative && value < 0) {
ret = false;
}
} else {
ret = false;
}
return ret;
}
},
[\]^_`
durchgelassen. Auch überprüft es nur, ob irgendwo ein "normales" Zeichen gefolgt von einem Leerzeichen vorkommt... die RegExp müsse in etwa so aussehen /^[a-z0-9]*$/i
'custom': {
characterMasking: /[\-\+\d]/,
regExpFilter: /^[a-z0-9]*$/i,
validation: function(value, options) {
if (value == '' || value == '-' || value == '+') {
return false;
}
var regExp = /^[a-z0-9]*$/i
;
if (!regExp.test(value)) {
return false;
}
options = options || {allowNegative:false};
var ret = parseInt(value, 10);
if (!isNaN(ret)) {
var allowNegative = true;
if (typeof options.allowNegative != 'undefined' && options.allowNegative == false) {
allowNegative = false;
}
if (!allowNegative && value < 0) {
ret = false;
}
} else {
ret = false;
}
return ret;
}
},
'custom': {
validation: function(value, options) {
if (value == '' || value == '-' || value == '+') {
return false;
}
var regExp = /^[a-z0-9]*$/i;
if (!regExp.test(value)) {
return false;
}
options = options || {allowNegative:false};
var ret = parseInt(value, 10);
if (!isNaN(ret)) {
var allowNegative = true;
} else {
ret = false;
}
return ret;
}
},
/[^a-z0-9]/i
Vorsicht, das zweite "nicht" muss raus!Heißt soviel wie "wenn der String nicht Zeichen enthält, die nicht a-z oder 0-9 unter Ignorierung von Groß- und Kleinschreibung enthält" dann ist der Ausdruck wahr.
^[a-z0-9]*$
Nein, lies nochmal genau. Nur zwei Verneinungen geben wahr.Vorsicht, das zweite "nicht" muss raus!
Hast du meinen Vorschlag auch getestet?Ich habe nun schon wieder sehr vieles ausprobiert, aber ich kenne mich einfach zu wenig aus (daher ja auch der Dreamweaver-Code..)