protip: ALWAYS use regular expression literals in JavaScript and TypeScript and any other language that supports it, instead of writing your regex out in a string. I cannot count how many critical security bugs I have found over the years from someone writing a regex like "^en\.wikipedia\.org$", which is incorrect because the \. is treated as *string* escape sequence (an invalid one that just produces .) which then results in the regex being "^en.wikipedia.org$" which matches "enowikipedia.org".
@gsuberland (Are regex literals different from raw strings?)

@cr1901 in JS and TS regex literals look like this:

const r = /^[a-z0-9]+\s[0-9]+$/i;

which is identical to writing:

const r = new RegExp("^[a-z0-9]+\\s[0-9]+$", "i");

it's a separate thing to raw strings.

@cr1901 note that I had to escape the backslash in the second one, which is error prone because if I mistakenly wrote \s then it would just be the letter s that got fed into the regex.