Matching Whitespace & Non-Whitespace Character

  • + 0 comments

    In my opinion, either the problem statement is ambigous or it is inconsistent with the test cases.

    Being an excercise to introduce the metacharacters \S and \s, the resolution should be simple and straightfoward, that is /^\S\S\s\S\S\s\S\S$/

    However that expression does not pass some of the test cases. Namely those with multiple whitespaces or non-whitespaces. Thus the solution should be /^\S\S+\s+\S\S+\s+\S\S+$/ which also do not work. So said!!