I am really stuck at this exercise. Even the solutions make me confused.
Q1: “\s”can’t replace white space at all times?
I notice that in both solutions, there is a space between" (\d+)" and" \1", however when i replace the space with “\s” to write code like this "let reRegex = /^(\d+)\s\1\s\1$/ ;“my code fails as it does not meet this condition"Failed:Your regex should not match the string 42\t42\t42.”
Alternative attempt “let reRegex =/^(\d+)(\s)\1\2\1$/” fails as well due to the same reason " Failed:Your regex should not match the string 42\t42\t42."
Q2: What is (?!.) in the solution 2 intended to do? I think It is a negative lookahead to make sure there is no “.” Why do we need this negative lookahead here?
there are many ways a regEx can be constructed, using more shorthands means making it much simpler
btw, this is what i could muster by looking at let reRegex = /(\d{2,})([ ])\1\2\1$/; // Change this line this is not a complete solution but somewhat close to it, if you would like to consider to be so
see if that makes sense to you and re-arrange this in a way to pass this step, happy learning
nb: if you would like to know more about regex consider looking into web cause there are some real good information such as tutorials and such, about it happy reading https://regexone.com/
i myself also very rookie in regex, but this resource might be helpful in describing what that notation means and more, happy reading Advanced Regex Tutorial—Regex Syntax