Start Scripting Build with Google I am writing a google apps script that pulls the content from a CSV file in a gmail attachment. It prevents the regex from matching characters before or after the number. Just split up your regex into two capture groups and concatenate with a random (infrequently used) character like ~. It returns an Object which retains all the matches, unlike an Array. The REGEX Formula Cookbook Template. Regex.Replace Method (System.Text.RegularExpressions) The Google Apps Script function replaceText() still doesn't accept escape characters, but I was able to get around this by using getText(), then the . Regex match Google Scripts Syntax for Regular Expressions To create a regular expression, you must use specific syntax—that is, special characters and construction rules. .replaceText ("\\v+", "") If you want to remove all "other" control characters ( C0, DEL and C1 control codes ), you may use .replaceText ("\\p {Cc}+", "") Note that the \v pattern is a construct supported by JavaScript regex engine, and is considered to match a vertical tab character (≡ \013) by the RE2 regex library used in most Google products. RegExr: Learn, Build, & Test RegEx Replace Pipe Symbol with a String. Formula # 3: =regexreplace (A3, " (. Find & Replace for Text Editing - Chrome Web Store The regular expression is a basic regular expression, and in addition you need to quote the delimiter for the s command.. You can pick a different delimiter to avoid having to quote /.You'll have to quote that character instead, but usually the point of changing the . JavaScript String replace() Method - W3Schools To include regular expressions in the string specified in the Replace with box, click the Use check box and then click Regular Expressions. Python regex offers sub() the subn() methods to search and replace patterns in a string. You can use use findText method with simple regular expressions to find text elements in the document that match a pattern and replace them with the specified text.