Please enter a valid email

Brilliant Staff have emails like [email protected] or [email protected] , i.e. a single alphanumeric word (sometimes with underscores or periods) or name followed by the site address.

Kenji wants to build an app which only the brilliant staff could use. Which of the following regex would be the best for him to use?


  1. .*@brilliant\.org

  2. \w+@brilliant\.org

  3. \[email protected]

  4. \w*@brilliant\.org

  5. .+@brilliant\.org

1) 2) 3) 4) 5)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Leland Foltz
Apr 23, 2015

From reading the wiki, we can gather that with regular expressions the "\w+" denotes that a word is permitted to preceed the "@brilliant". Following the word is another break () prior to the .org, for reasons unbeknownst to me, though I assume it is because the ".org/com/uk/etc" has special rules. SAVE US TECHIES.

I can't understand what it is that you're asking. Can you try again?

Josh Silverman Staff - 5 years, 10 months ago

\w+ means that one or more "word characters" must precede the "@brilliant". the \ in brilliant.org represents the . as a literal character. \ "escapes" the metacharacter . which represents any single character in a regular expression.

Tim Martin - 5 years, 6 months ago

I find the options available to be strange. In the example it states "sometimes with underscores or periods", but w+ alone does not capture the "." so [email protected] would not match. Therefore the regex would need to be "[\w+.][email protected]".

Evgeny Danilenko - 6 months, 3 weeks ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...