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.
The goal of this is to write a pattern that can be used as a regex to determine if a sub-string of the given pattern is present in the data or not.
'xxx xx xx' is true because of the part of the string that is 'xx xx xx' (remove the first character).
'xx xxx xx' is false because there is no sub-string that follows the pattern. There are two spaces but the 3 non-space characters in the middle makes a match impossible.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matching Whitespace & Non-Whitespace Character
You are viewing a single comment's thread. Return to all comments →
The goal of this is to write a pattern that can be used as a regex to determine if a sub-string of the given pattern is present in the data or not.
'xxx xx xx' is true because of the part of the string that is 'xx xx xx' (remove the first character).
'xx xxx xx' is false because there is no sub-string that follows the pattern. There are two spaces but the 3 non-space characters in the middle makes a match impossible.