Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 280 Bytes

File metadata and controls

12 lines (8 loc) · 280 Bytes

Trovate gli interi non negativi

Data una stringa di numeri interi, create una regexp che cerchi solo quelli non negativi (lo zero è consentito).

Un esempio d'uso:

let regexp = /your regexp/g;

let str = "0 12 -5 123 -18";

alert( str.match(regexp) ); // 0, 12, 123