Learn Regular expression by building a Spam Filter step 26

Hello, I have a issue with the question of project I don’t see the error. Here is my code:

const freeRegex = /(?:\s|^)?fr[e3][e3] m[o0]n[e3]y\s)/i;

by using the ?: you already made it a non-capturing group, so you shouldnt use another question mark after the group. also you have an extra ) in the end of your regex! happy coding :slight_smile:

I did it but it doesn’t work /(?:\s|^)fr[e3][e3] m[o0]n[e3]y\s)?/i;

you added another question mark in the end, where you should only have removed the extra closing parenthesis ). this one is not closing anything, and it also doesnt need a question mark there, just erase them both.

2 Likes

thank you for your help it work

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.