OliverJUnit mit änderung wegen DEL-Zeichen
parent
e7aa96947a
commit
458e3d20db
|
|
@ -27,12 +27,15 @@ if (passwort == null){
|
|||
public static boolean checkZiffer(String passwort) {
|
||||
if (passwort == null) {
|
||||
return false;
|
||||
}// Abfrage der Ziffern
|
||||
} // Abfrage der ZiffernS
|
||||
|
||||
return passwort.matches(".*[0-9].*[0-9].*[0-9].*");
|
||||
}
|
||||
|
||||
public static boolean checkSonderZeichen(String passwort) {
|
||||
if (passwort == null) {
|
||||
return false;
|
||||
}
|
||||
// Überprüfung mit Regex durch Ausschluss
|
||||
// [^A-Za-z0-9] Schließt alle ziffern und Buchstaben aus
|
||||
// Ausschlus der Steuerzeichen:
|
||||
|
|
@ -40,11 +43,12 @@ if (passwort == null){
|
|||
// [^/r] schließt Carriage Return aus
|
||||
// [^/n] schließt Line Feed aus
|
||||
// [^A-Za-z0-9\\x00-\\x1F\\x7F] [^A-Za-z0-9\t\r\n]
|
||||
String reg = "[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E]";
|
||||
String reg = "[\\x20-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E\\x80]";
|
||||
return passwort.matches(".*" + reg + ".*" + reg + ".*" + reg + ".*");
|
||||
// String negReg = "[^A-Za-z0-9\\x00-\\x1F\\x7F]";
|
||||
// return passwort.matches(".*"+negReg+".*"+negReg+".*"+negReg+".*");
|
||||
//return passwort.matches(".*[^A-Za-z0-9\\x00-\\x1F\\x7F].*[^A-Za-z0-9\\x00-\\x1F\\x7F].*[^A-Za-z0-9\\x00-\\x1F\\x7F].*");
|
||||
// return
|
||||
// passwort.matches(".*[^A-Za-z0-9\\x00-\\x1F\\x7F].*[^A-Za-z0-9\\x00-\\x1F\\x7F].*[^A-Za-z0-9\\x00-\\x1F\\x7F].*");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
package Pflichtuebung_4;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
|
@ -45,7 +44,7 @@ public class Test_Passwords_Oliver_S {
|
|||
final static int STOP_CHAR_SONDERZ_3 = 96;
|
||||
|
||||
final static int START_CHAR_SONDERZ_4 = 123;
|
||||
final static int STOP_CHAR_SONDERZ_4 = 127;
|
||||
final static int STOP_CHAR_SONDERZ_4 = 126;
|
||||
|
||||
@FunctionalInterface
|
||||
interface Check_X_Interface{
|
||||
|
|
|
|||
Loading…
Reference in New Issue