-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2p.js
47 lines (40 loc) · 791 Bytes
/
2p.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Passwords must be between 16 and 30 characters - done
// and contain at least one upper case letter
// one lower case letter,
// one number and
// one special character (do not use @ * &).
/**
*
* @param {string} s
*/
function f(s) {
const regex1 = /.{16,30}/g;
const regex2 = /1/gi;
const ret = regex1.test(s) && regex2.test(s);
return ret;
}
/**
*
* @param {string} s
*
*/
function getStringLength(s) {
let count = 0;
for (let i = s.length - 1; i >= 0; --i) {
count++;
}
return count;
}
/**
*
* @param {string} s
*/
function wasSensitiveCase(s) {
const regex = /[A-Z]{1}/gi;
return regex.test(s);
}
const s = "12345678900987654321Duc";
// console.log(f(s));
// console.log(getStringLength(s));
const s2 = "s";
console.log(wasSensitiveCase(s2));