We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 7: Regular Expressions II
Day 7: Regular Expressions II
Sort by
recency
|
211 Discussions
|
Please Login in order to post a comment
const re =/^(Mr\.|Mrs\.|Ms\.|Dr\.|Er\.)[a-zA-Z]+$/
Something a bit different:
Anyone new to coding and JS know to include the extra backslash if declaring it as an object? I used a literal to answer after failing in frustration to get the object to work. Needed to google to get the backslash explanation. Would be nice if it was included in the solution as its a "first 10 days of JS" tutorial problem, as I didn't have the intuition upon seeing it to know why its needed.
vs.