The current method of detecting usernames is not robust and can trigger false positives. In particular, it is susceptible to detecting matches in the middle of URLs for short usernames. Transitioning to a regex-based system rather than relying on the includes() method of String objects would be desirable.
Example: u/cos gets detected in https://watson.brown.edu/costsofwar/costs/human/military