kembali ke pelajaran
Materi ini hanya tersedia dalam bahasa berikut: English, Espa??ol, Fran??ais, Italiano, ?????????, ?????????, ??????????????, ????????????????????, ????????????. Tolong, menerjemahkan ke dalam Indonesia.

How to find an ellipsis "..." ?

pentingnya: 5

Create a regexp to find ellipsis: 3 (or more?) dots in a row.

Check it:

let regexp = /your regexp/g;
alert( "Hello!... How goes?.....".match(regexp) ); // ..., .....

Solution:

let regexp = /\.{3,}/g;
alert( "Hello!... How goes?.....".match(regexp) ); // ..., .....

Please note that the dot is a special character, so we have to escape it and insert as \..