Potential usage: grep search/replace for a site full of Google Analytics to migrate to Universal Google Analytics. Matching Regex for all instances of _gaq.push /_gaq\.push\(\[‘_[^’]*'(,? ?[^,(\]\);)]*){0,4}?]\);/g Play with it here: regexr.com/38pp5