I want to know if I would be able to replace different words all in one regex expression. For example if I wanted to replace the name John with Joe and Smith with Doe. Would I be able to do that with one expression?
Here is a code that I have that changes the misspelled name correctly, however I need to replace two more different words with something else:
Pattern replace = Pattern.compile("nam"); Matcher match = replace.matcher(words); words = match.replaceAll("name");