From: Lucas Kanashiro <kanashiro@debian.org>
Date: Mon, 27 Jan 2025 05:57:50 -0300
Subject: Fix autopkgtest regression with ruby3.3

Replace usage of 3-argument Regexp.new.

Ruby 3.3 removed the 3-argument Regexp.new/compile
and recommends using the 2-argument overload by
adding the NOENCODING flag which was the only value
supported ('n'/'N') by the third argument
(encoding).

Forwarded: no
---
 lib/docdiff/view.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/docdiff/view.rb b/lib/docdiff/view.rb
index b691a67..1ef0b58 100644
--- a/lib/docdiff/view.rb
+++ b/lib/docdiff/view.rb
@@ -93,9 +93,9 @@ class View
   CONTEXT_POST_LENGTH = 32
   def apply_style_digest(tags, headfoot = true)
     cxt_pre_pat  = Regexp.new('.{0,'+"#{CONTEXT_PRE_LENGTH}"+'}\Z',
-                              Regexp::MULTILINE, encname_for_regexp(@encoding))
+                              Regexp::NOENCODING)
     cxt_post_pat = Regexp.new('\A.{0,'+"#{CONTEXT_POST_LENGTH}"+'}',
-                              Regexp::MULTILINE, encname_for_regexp(@encoding))
+                              Regexp::NOENCODING)
     display = (tags and tags[:display]) || 'inline'
     result = []
     d1l = doc1_line_number = 1
