diff --git a/lib/gitlab/diff/inline_diff.rb b/lib/gitlab/diff/inline_diff.rb
index 4a3eb92b9fcab8ddf8ab3a0767e53b416d384f83..28ad637fda455b646e3faab3ec207499e0ad0814 100644
--- a/lib/gitlab/diff/inline_diff.rb
+++ b/lib/gitlab/diff/inline_diff.rb
@@ -2,7 +2,7 @@ module Gitlab
   module Diff
     class InlineDiff
       # Regex to find a run of deleted lines followed by the same number of added lines
-      REGEX = %r{
+      LINE_PAIRS_PATTERN = %r{
         # Runs start at the beginning of the string (the first line) or after a space (for an unchanged line)
         (?:\A|\s)
 
@@ -72,7 +72,7 @@ module Gitlab
         line_prefixes = lines.each_with_object("") { |line, s| s << line[0] }.gsub(/[^ +-]/, ' ')
 
         changed_line_pairs = []
-        line_prefixes.scan(REGEX) do
+        line_prefixes.scan(LINE_PAIRS_PATTERN) do
           # For `"---+++"`, `begin_index == 0`, `end_index == 6`
           begin_index, end_index = Regexp.last_match.offset(:del_ins)