\w match "word" symbols (letters, digits and underscore) but in your example there is / after com which is not :alnum: so your pattern match nothing == empty output.
You can add / to pattern and look what is happend:
grep -oP 'com\/\K\w+'
\w match "word" symbols (letters, digits and underscore) but in your example there is / after com which is not :alnum: so your pattern match nothing == empty output.
You can add / to pattern and look what is happend:
grep -oP 'com\/\K\w+'