It indicates that the subpattern is a non-capture subpattern. That means whatever is matched in (?:\w+\s), even though it's enclosed by () it won't appear in the list of matches, only (\w+) will.
You're still looking for a specific pattern (in this case, a single whitespace character following at least one word), but you don't care what's actually matched.
?= is a positive lookahead, a type of zero-width assertion. What it's saying is that the captured match must be followed by whatever is within the parentheses but that part isn't captured.
Your example means the match needs to be followed by zero or more characters and then a digit (but again that part isn't captured).
Best Answer
It indicates that the subpattern is a non-capture subpattern. That means whatever is matched in
(?:\w+\s)
, even though it's enclosed by()
it won't appear in the list of matches, only(\w+)
will.You're still looking for a specific pattern (in this case, a single whitespace character following at least one word), but you don't care what's actually matched.