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.
Matching Anything But a Newline
Matching Anything But a Newline
Sort by
recency
|
397 Discussions
|
Please Login in order to post a comment
Shouldn't it be:
^\.{3}(\..{3}){3}$
because you want to match"..."
followed by"\..."
3 times?However, something like
^(\.?.{3}){4}$
would also match "..." repeated 4 times, e.g. "abcabcabcabc"? Unless I just misunderstood the question.You can use the regex ^(.?[^\n]{3}){4}$.
I don't understand the definition of this task click here">.
Shouldn't ruby code be using 'match?' instead of 'match'