-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp20.js
More file actions
39 lines (27 loc) · 1.07 KB
/
Copy pathapp20.js
File metadata and controls
39 lines (27 loc) · 1.07 KB
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
//var reg1 = RegExp("a");
var reg2 = /a/;
var texto = "Holaa Mundoo, 12345\nHola ú "
var texto1 = "Aeropuerto"
console.log(texto.match( reg2 ));
console.log(texto.match( /^H/ ));
console.log(texto.match( /.$/ ));
console.log(texto.match( /.../ ));
console.log(texto.match( /^.o/ ));
console.log(texto.match( /[0-9]/ ));
console.log(texto.match( /[a-zA-Z]/ ));
console.log(texto.match( /^H[a-z]/ ));
console.log(texto.match( / / ));
console.log(texto.match( /\s/ )); // any separation
console.log(texto.match( /\w/ )); //any letter and number
console.log(texto.match( /\d/ )); // any number
console.log(texto.match( /m/i )); // i (no case sensitive) g (Every appearance) m (multi-line)
console.log(texto.match( /[AEIuo]|ú/igm));
console.log(texto.match( /o+/g ));
console.log(texto.match( /o?/g ));
console.log(texto.match( /o*/g ));
console.log(texto.match( /o{2,}/g ));
console.log(texto1.match( /[aeiou]{2,}/ig ));
var texto2 = "asdkljsa asdjasdkl alkdjsajkl 60 + 40 = 123"
console.log(texto1.match( /\w{2,}/ig ));
console.log(texto2.match( /\d{1,}/g ))
//Mozilla regular expression!