That result is returned because the regex of (?!\.com) is a negative lookahead, which makes sure whatever matches w+ is not the “.com”. Regex looks ahead after each possible \w+ match. WHen regex looks at www_example123 if would not find a match because .com is immediately after the w+ match… so what happens is the regex stops at www_example12 which leaves 3 between the match for w+ and the negative lookahead used (?!\.com).
If you want to capture the full string www_example123, you could change the regex to use a positive lookahead, so that whatever is after w+ must be “.com”… something like: r'\w+(?=\.com) (notice the equals sign).
If you haven’t already, you could check out sites like https://regex101.com/ and play around with different regex expressions and target strings to get the intuition for a particular search.