newDocuments = regexprep( documents , expression , replace ) replaces all occurrences of the regular expression expression in the words of documents with the text in replace . The function matches each word independently. The match does not have to span the whole word.