Learn Regular Expressions by Building a Spam Filter - Step 17

I’m stuck here as well. Here’s my code:
const dollarRegex = /[0-9]+ hundred| thousand| million| billion dollars/i;
I get the message:

Your dollarRegex should use the | token to match hundred, thousand, million, or billion.

If I put a | before hundred, or after billion, I get the msg:

  1. Your dollarRegex should have three | tokens.>

So what am I supposed to do? Iogically, I think the [numbers & hundred] and [billions & dollars] should be separated. Yet, I’m not allowed more than 3 alternate sequences.

you have too many spaces in your expression. Please open your own topic in future when you need help. If you have a follow up, please don’t keep replying here and use the Help button to get more help at that point.

Thanks, got it with that advice. Sure, I’ll open new top in future.

1 Like