In order to replace text using regular expression use the re. sub function: Sub (pattern, repl, string [, count, flags]) it will replace non-everlaping instances of pattern by the text passed as string. For anyone else arriving here from google search on how to do a string replacement on all columns (for example, if one has multiple columns like the op's 'range' column):