function newStr = eraseURLs(str)
%

% Copyright 2016-2022 The MathWorks, Inc.

narginchk(1,1);
textanalytics.internal.validateString(str);

% from RFC 3986, together with {} for compatibility with SharePoint
pattern = 'https?://[a-zA-Z0-9\x{80}-\x{10ffff}.-]+(?:\w|[.~:/?#\[\]@!$&''()*+,;=%{}-])*';

newStr = regexprep(str,pattern,'','ignorecase');
