For instance, we write
const regex = /^s+$/;
to define a
regex that matches a string with all spaces by using
^ to match the start of the string,
s+ to match spaces, and
$ to match the end of the string.