hey been stuck on step 20 of the spam filter for like 4 hours - can some assist please.
Replace the first literal space with the \s* expression.
Replace the second literal space with \s+ expression
tried so many configurations including different brackets like (). {} and and can’t figure it out. Please explain like im 5 because this is confusing as hell.
my code:
const dollarRegex = /[0-9]+\s*(hundred|thousand|million|billion)?dollars\s+/i;
Here is a comparison of the original code and your code.
The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.
Replace the first literal space with the \s* expression. The \s character class matches whitespace, such as spaces, tabs, and new lines. The * quantifier means “match the previous character 0 or more times”. ✓
Replace the second literal space with \s+. The + quantifier means “match the previous character at least one time”. ✗
The second literal space is before the word dollar