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
|
213 Discussions
|
Please Login in order to post a comment
const re = / ^ ( open_square_brackets ^ backslash . ^ backslash s closed_square_brackets * backslash . ) { 1 } open_square_brackets ^ backslash . closed_square_brackets * $ /
Start pattern has (anything except a dot or space, then a dot.). Start pattern repeats once. After that anything except a dot.
The backslashes do not show up correctly inside the square brackets so the pattern is written above with text.
this handels all the chases require which the top ones dont take into account like "Msr.abc"or "Ds.abc"
const re =/^(Mr\.|Mrs\.|Ms\.|Dr\.|Er\.)[a-zA-Z]+$/
Something a bit different: