# Buggy code
def set_pattern(self, val):
    """Setter for pattern.

    Args:
        val: The value to set.
    """
    self._pattern = val
    val = re.sub(r" +", r" ", val)  # See #1919
    val = re.escape(val)
    val = val.replace(r"\ ", ".*")
    if len(val) > 5000:  # avoid crash on huge search terms (#5973)
        log.completion.warning(f"Pattern too long ({len(val)})")
        val = "^$"
    rx = QRegularExpression(val, QRegularExpression.CaseInsensitiveOption)
    qtutils.ensure_valid(rx)
    self.setFilterRegularExpression(rx)
    self.invalidate()
    sortcol = 0
    self.sort(sortcol)


# Traceback (qutebrowser.utils.qtutils.QtValueError)
16:00:59 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Definitive match for 'go'.
16:00:59 DEBUG    keyboard   basekeyparser:_debug_log:216 NormalKeyParser for mode normal: Clearing keystring (was: go).
16:00:59 DEBUG    commands   command:run:538 command called: set-cmd-text [':open data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A        <title>Error loading page%3A https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A        <style type%3D"text%2Fcss">%0A            %0A%0A            body {%0A                margin%3A 0%3B%0A                padding%3A 0%3B%0A            }%0A            %0A%2A {%0A%09margin%3A 0px 0px%3B%0A%09padding%3A 0px 0px%3B%0A}%0A%0Abody {%0A%09font-family%3A "Helvetica Neue"%2C Helvetica%2C Arial%2C sans-serif%3B%0A%09-webkit-text-size-adjust%3A none%3B%0A%09color%3A %23333333%3B%0A%09background-color%3A %23EEEEEE%3B%0A%09font-size%3A 1.2em%3B%0A}%0A%0A%23error-container {%0A%09margin-left%3A 20px%3B%0A%09margin-right%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09border%3A 1px solid %23CCCCCC%3B%0A%09box-shadow%3A 0px 0px 6px rgba%280%2C 0%2C 0%2C 0.20%29%3B%0A%09border-radius%3A 5px%3B%0A%09background-color%3A %23FFFFFF%3B%0A%09padding%3A 20px 20px%3B%0A}%0A%0A%23header {%0A%09border-bottom%3A 1px solid %23CCC%3B%0A}%0A%0A.qutebrowser-broken {%0A%09display%3A block%3B%0A%09width%3A 100%25%3B%0A}%0A%0Atd {%0A%09margin-top%3A 20px%3B%0A%09color%3A %23555%3B%0A}%0A%0Ah1 {%0A%09font-weight%3A normal%3B%0A%09color%3A %231e89c6%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0Aul {%0A%09margin-left%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09margin-bottom%3A 20px%3B%0A}%0A%0Ali {%0A%09margin-top%3A 10px%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0A        <%2Fstyle>%0A        <script type%3D"text%2Fjavascript">%0A            %0A%0A            %0Afunction tryagain%28%29%0A{%0A    location.href %3D "https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest"%3B%0A}%0A%0A        <%2Fscript>%0A    <%2Fhead>%0A    <body>%0A        %0A<div id%3D"error-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td style%3D"width%3A 10%25%3B vertical-align%3A top%3B">%0A%09%09%09%09<img style%3D"width%3A 100%25%3B display%3A block%3B max-width%3A 256px%3B" src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1><base64 data 2>" %2F>%0A%09%09%09<%2Ftd>%0A%09%09%09<td style%3D"padding-left%3A 40px%3B">%0A%09%09%09%09<h1>Unable to load page<%2Fh1>%0A%09%09%09%09Error while opening https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<br>%0A%09%09%09%09<p id%3D"error-message-text" style%3D"color%3A %23a31a1a%3B">HTTP ERROR 404<%2Fp><br><br>%0A%0A%09%09%09%09<form name%3D"bl">%0A%09%09%09%09%09<input type%3D"button" value%3D"Try again" onclick%3D"javascript%3Atryagain%28%29" %2F>%0A%09%09%09%09<%2Fform>%0A%09%09%09<%2Ftd>%0A%09%09<%2Ftr>%0A%09<%2Ftable>%0A<%2Fdiv>%0A%0A    <%2Fbody>%0A<%2Fhtml>']
16:00:59 DEBUG    commands   command:run:552 Calling qutebrowser.mainwindow.statusbar.command.Command.set_cmd_text_command(<qutebrowser.mainwindow.statusbar.command.Command>, ':open data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A       …, None, False, False, False)
16:00:59 DEBUG    completion completer:schedule_completion_update:216 Scheduling completion update.
16:00:59 DEBUG    completion completer:schedule_completion_update:213 Ignoring update because there were no changes.
16:00:59 DEBUG    modes      command:set_cmd_text:111 Setting command text, focusing <qutebrowser.mainwindow.statusbar.command.Command>
16:00:59 DEBUG    modes      modeman:enter:362 Entering mode KeyMode.command (reason: cmd focus)
16:00:59 DEBUG    statusbar  bar:set_mode_active:312 Setting command flag to True
16:00:59 DEBUG    misc       app:on_focus_object_changed:550 Focus object changed: <qutebrowser.mainwindow.statusbar.command.Command>
16:00:59 DEBUG    misc       app:on_focus_object_changed:550 Focus object changed: <PyQt5.QtWidgets.QWidget object at 0x7f9103aeef70>
16:00:59 DEBUG    misc       app:on_focus_object_changed:550 Focus object changed: <qutebrowser.mainwindow.statusbar.command.Command>
16:00:59 DEBUG    modes      modeman:_handle_keypress:311 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: False, dry_run: False --> filter: True (focused: <qutebrowser.mainwindow.statusbar.command.Command>)
16:00:59 DEBUG    completion completer:_partition:143 partitioning ['open', ' data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A        <title>Error loading page%3A https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A        <style type%3D"text%2Fcss">%0A            %0A%0A            body {%0A                margin%3A 0%3B%0A                padding%3A 0%3B%0A            }%0A            %0A%2A {%0A%09margin%3A 0px 0px%3B%0A%09padding%3A 0px 0px%3B%0A}%0A%0Abody {%0A%09font-family%3A "Helvetica Neue"%2C Helvetica%2C Arial%2C sans-serif%3B%0A%09-webkit-text-size-adjust%3A none%3B%0A%09color%3A %23333333%3B%0A%09background-color%3A %23EEEEEE%3B%0A%09font-size%3A 1.2em%3B%0A}%0A%0A%23error-container {%0A%09margin-left%3A 20px%3B%0A%09margin-right%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09border%3A 1px solid %23CCCCCC%3B%0A%09box-shadow%3A 0px 0px 6px rgba%280%2C 0%2C 0%2C 0.20%29%3B%0A%09border-radius%3A 5px%3B%0A%09background-color%3A %23FFFFFF%3B%0A%09padding%3A 20px 20px%3B%0A}%0A%0A%23header {%0A%09border-bottom%3A 1px solid %23CCC%3B%0A}%0A%0A.qutebrowser-broken {%0A%09display%3A block%3B%0A%09width%3A 100%25%3B%0A}%0A%0Atd {%0A%09margin-top%3A 20px%3B%0A%09color%3A %23555%3B%0A}%0A%0Ah1 {%0A%09font-weight%3A normal%3B%0A%09color%3A %231e89c6%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0Aul {%0A%09margin-left%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09margin-bottom%3A 20px%3B%0A}%0A%0Ali {%0A%09margin-top%3A 10px%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0A        <%2Fstyle>%0A        <script type%3D"text%2Fjavascript">%0A            %0A%0A            %0Afunction tryagain%28%29%0A{%0A    location.href %3D "https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest"%3B%0A}%0A%0A        <%2Fscript>%0A    <%2Fhead>%0A    <body>%0A        %0A<div id%3D"error-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td style%3D"width%3A 10%25%3B vertical-align%3A top%3B">%0A%09%09%09%09<img style%3D"width%3A 100%25%3B display%3A block%3B max-width%3A 256px%3B" src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1>'] around position 32766
16:00:59 DEBUG    completion completer:_partition:155 partitioned: ['open'] 'data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A        <title>Error loading page%3A https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A        <style type%3D"text%2Fcss">%0A            %0A%0A            body {%0A                margin%3A 0%3B%0A                padding%3A 0%3B%0A            }%0A            %0A%2A {%0A%09margin%3A 0px 0px%3B%0A%09padding%3A 0px 0px%3B%0A}%0A%0Abody {%0A%09font-family%3A "Helvetica Neue"%2C Helvetica%2C Arial%2C sans-serif%3B%0A%09-webkit-text-size-adjust%3A none%3B%0A%09color%3A %23333333%3B%0A%09background-color%3A %23EEEEEE%3B%0A%09font-size%3A 1.2em%3B%0A}%0A%0A%23error-container {%0A%09margin-left%3A 20px%3B%0A%09margin-right%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09border%3A 1px solid %23CCCCCC%3B%0A%09box-shadow%3A 0px 0px 6px rgba%280%2C 0%2C 0%2C 0.20%29%3B%0A%09border-radius%3A 5px%3B%0A%09background-color%3A %23FFFFFF%3B%0A%09padding%3A 20px 20px%3B%0A}%0A%0A%23header {%0A%09border-bottom%3A 1px solid %23CCC%3B%0A}%0A%0A.qutebrowser-broken {%0A%09display%3A block%3B%0A%09width%3A 100%25%3B%0A}%0A%0Atd {%0A%09margin-top%3A 20px%3B%0A%09color%3A %23555%3B%0A}%0A%0Ah1 {%0A%09font-weight%3A normal%3B%0A%09color%3A %231e89c6%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0Aul {%0A%09margin-left%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09margin-bottom%3A 20px%3B%0A}%0A%0Ali {%0A%09margin-top%3A 10px%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0A        <%2Fstyle>%0A        <script type%3D"text%2Fjavascript">%0A            %0A%0A            %0Afunction tryagain%28%29%0A{%0A    location.href %3D "https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest"%3B%0A}%0A%0A        <%2Fscript>%0A    <%2Fhead>%0A    <body>%0A        %0A<div id%3D"error-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td style%3D"width%3A 10%25%3B vertical-align%3A top%3B">%0A%09%09%09%09<img style%3D"width%3A 100%25%3B display%3A block%3B max-width%3A 256px%3B" src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1>' []
16:00:59 DEBUG    completion completer:_update_completion:238 Updating completion: ['open'] data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A        <title>Error loading page%3A https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A        <style type%3D"text%2Fcss">%0A            %0A%0A            body {%0A                margin%3A 0%3B%0A                padding%3A 0%3B%0A            }%0A            %0A%2A {%0A%09margin%3A 0px 0px%3B%0A%09padding%3A 0px 0px%3B%0A}%0A%0Abody {%0A%09font-family%3A "Helvetica Neue"%2C Helvetica%2C Arial%2C sans-serif%3B%0A%09-webkit-text-size-adjust%3A none%3B%0A%09color%3A %23333333%3B%0A%09background-color%3A %23EEEEEE%3B%0A%09font-size%3A 1.2em%3B%0A}%0A%0A%23error-container {%0A%09margin-left%3A 20px%3B%0A%09margin-right%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09border%3A 1px solid %23CCCCCC%3B%0A%09box-shadow%3A 0px 0px 6px rgba%280%2C 0%2C 0%2C 0.20%29%3B%0A%09border-radius%3A 5px%3B%0A%09background-color%3A %23FFFFFF%3B%0A%09padding%3A 20px 20px%3B%0A}%0A%0A%23header {%0A%09border-bottom%3A 1px solid %23CCC%3B%0A}%0A%0A.qutebrowser-broken {%0A%09display%3A block%3B%0A%09width%3A 100%25%3B%0A}%0A%0Atd {%0A%09margin-top%3A 20px%3B%0A%09color%3A %23555%3B%0A}%0A%0Ah1 {%0A%09font-weight%3A normal%3B%0A%09color%3A %231e89c6%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0Aul {%0A%09margin-left%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09margin-bottom%3A 20px%3B%0A}%0A%0Ali {%0A%09margin-top%3A 10px%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0A        <%2Fstyle>%0A        <script type%3D"text%2Fjavascript">%0A            %0A%0A            %0Afunction tryagain%28%29%0A{%0A    location.href %3D "https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest"%3B%0A}%0A%0A        <%2Fscript>%0A    <%2Fhead>%0A    <body>%0A        %0A<div id%3D"error-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td style%3D"width%3A 10%25%3B vertical-align%3A top%3B">%0A%09%09%09%09<img style%3D"width%3A 100%25%3B display%3A block%3B max-width%3A 256px%3B" src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1> []
16:00:59 DEBUG    completion completer:_get_new_completion:91 Before removing flags: ['open']
16:00:59 DEBUG    completion completer:_get_new_completion:104 After removing flags: ['open']
16:00:59 DEBUG    completion debug:__exit__:302 Starting url completion took 0.001829 seconds.
16:00:59 DEBUG    misc       mainwindow:_update_overlay_geometry:350 new geometry for <qutebrowser.completion.completionwidget.CompletionView>: PyQt5.QtCore.QRect(0, 1041, 1905, 1064)
16:00:59 DEBUG    completion debug:__exit__:302 Set completion model took 0.00461 seconds.
16:00:59 DEBUG    completion completionmodel:set_pattern:181 Setting completion pattern 'data:text/html;charset=UTF-8,<%21DOCTYPE html>%0A<%21--%0Avim%3A ft%3Dhtml fileencoding%3Dutf-8 sts%3D4 sw%3D4 et%3A%0A-->%0A%0A<html>%0A    <head>%0A        <meta charset%3D"utf-8">%0A        <title>Error loading page%3A https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A        <style type%3D"text%2Fcss">%0A            %0A%0A            body {%0A                margin%3A 0%3B%0A                padding%3A 0%3B%0A            }%0A            %0A%2A {%0A%09margin%3A 0px 0px%3B%0A%09padding%3A 0px 0px%3B%0A}%0A%0Abody {%0A%09font-family%3A "Helvetica Neue"%2C Helvetica%2C Arial%2C sans-serif%3B%0A%09-webkit-text-size-adjust%3A none%3B%0A%09color%3A %23333333%3B%0A%09background-color%3A %23EEEEEE%3B%0A%09font-size%3A 1.2em%3B%0A}%0A%0A%23error-container {%0A%09margin-left%3A 20px%3B%0A%09margin-right%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09border%3A 1px solid %23CCCCCC%3B%0A%09box-shadow%3A 0px 0px 6px rgba%280%2C 0%2C 0%2C 0.20%29%3B%0A%09border-radius%3A 5px%3B%0A%09background-color%3A %23FFFFFF%3B%0A%09padding%3A 20px 20px%3B%0A}%0A%0A%23header {%0A%09border-bottom%3A 1px solid %23CCC%3B%0A}%0A%0A.qutebrowser-broken {%0A%09display%3A block%3B%0A%09width%3A 100%25%3B%0A}%0A%0Atd {%0A%09margin-top%3A 20px%3B%0A%09color%3A %23555%3B%0A}%0A%0Ah1 {%0A%09font-weight%3A normal%3B%0A%09color%3A %231e89c6%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0Aul {%0A%09margin-left%3A 20px%3B%0A%09margin-top%3A 20px%3B%0A%09margin-bottom%3A 20px%3B%0A}%0A%0Ali {%0A%09margin-top%3A 10px%3B%0A%09margin-bottom%3A 10px%3B%0A}%0A%0A        <%2Fstyle>%0A        <script type%3D"text%2Fjavascript">%0A            %0A%0A            %0Afunction tryagain%28%29%0A{%0A    location.href %3D "https%3A%2F%2F<redacted uuid>.idocker.vuln.land%2Fcat%2Ffiles%2Ftest"%3B%0A}%0A%0A        <%2Fscript>%0A    <%2Fhead>%0A    <body>%0A        %0A<div id%3D"error-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td style%3D"width%3A 10%25%3B vertical-align%3A top%3B">%0A%09%09%09%09<img style%3D"width%3A 100%25%3B display%3A block%3B max-width%3A 256px%3B" src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1>'
16:00:59 DEBUG    completion debug:__exit__:302 Set pattern data:text/html;charset=utf-8,<%21doctype html>%0a<%21--%0avim%3a ft%3dhtml fileencoding%3dutf-8 sts%3d4 sw%3d4 et%3a%0a-->%0a%0a<html>%0a    <head>%0a        <meta charset%3d"utf-8">%0a        <title>error loading page%3a https%3a%2f%2f<redacted uuid>.idocker.vuln.land%2fcat%2ffiles%2ftest<%2ftitle>%0a        <style type%3d"text%2fcss">%0a            %0a%0a            body {%0a                margin%3a 0%3b%0a                padding%3a 0%3b%0a            }%0a            %0a%2a {%0a%09margin%3a 0px 0px%3b%0a%09padding%3a 0px 0px%3b%0a}%0a%0abody {%0a%09font-family%3a "helvetica neue"%2c helvetica%2c arial%2c sans-serif%3b%0a%09-webkit-text-size-adjust%3a none%3b%0a%09color%3a %23333333%3b%0a%09background-color%3a %23eeeeee%3b%0a%09font-size%3a 1.2em%3b%0a}%0a%0a%23error-container {%0a%09margin-left%3a 20px%3b%0a%09margin-right%3a 20px%3b%0a%09margin-top%3a 20px%3b%0a%09border%3a 1px solid %23cccccc%3b%0a%09box-shadow%3a 0px 0px 6px rgba%280%2c 0%2c 0%2c 0.20%29%3b%0a%09border-radius%3a 5px%3b%0a%09background-color%3a %23ffffff%3b%0a%09padding%3a 20px 20px%3b%0a}%0a%0a%23header {%0a%09border-bottom%3a 1px solid %23ccc%3b%0a}%0a%0a.qutebrowser-broken {%0a%09display%3a block%3b%0a%09width%3a 100%25%3b%0a}%0a%0atd {%0a%09margin-top%3a 20px%3b%0a%09color%3a %23555%3b%0a}%0a%0ah1 {%0a%09font-weight%3a normal%3b%0a%09color%3a %231e89c6%3b%0a%09margin-bottom%3a 10px%3b%0a}%0a%0aul {%0a%09margin-left%3a 20px%3b%0a%09margin-top%3a 20px%3b%0a%09margin-bottom%3a 20px%3b%0a}%0a%0ali {%0a%09margin-top%3a 10px%3b%0a%09margin-bottom%3a 10px%3b%0a}%0a%0a        <%2fstyle>%0a        <script type%3d"text%2fjavascript">%0a            %0a%0a            %0afunction tryagain%28%29%0a{%0a    location.href %3d "https%3a%2f%2f<redacted uuid>.idocker.vuln.land%2fcat%2ffiles%2ftest"%3b%0a}%0a%0a        <%2fscript>%0a    <%2fhead>%0a    <body>%0a        %0a<div id%3d"error-container">%0a%09<table>%0a%09%09<tr>%0a%09%09%09<td style%3d"width%3a 10%25%3b vertical-align%3a top%3b">%0a%09%09%09%09<img style%3d"width%3a 100%25%3b display%3a block%3b max-width%3a 256px%3b" src%3d"data%3aimage%2fpng%3bbase64%2c<base64 data 1> took 0.002357 seconds.
16:00:59 ERROR    misc       crashsignal:_handle_early_exits:240 Uncaught exception
Traceback (most recent call last):
File "/home/florian/proj/qutebrowser/git/qutebrowser/completion/completer.py", line 273, in _update_completion
completion.set_pattern(pattern)
File "/home/florian/proj/qutebrowser/git/qutebrowser/completion/completionwidget.py", line 385, in set_pattern
self.model().set_pattern(pattern)
File "/home/florian/proj/qutebrowser/git/qutebrowser/completion/models/completionmodel.py", line 184, in set_pattern
cat.set_pattern(pattern)
File "/home/florian/proj/qutebrowser/git/qutebrowser/completion/models/listcategory.py", line 67, in set_pattern
qtutils.ensure_valid(rx)
File "/home/florian/proj/qutebrowser/git/qutebrowser/utils/qtutils.py", line 170, in ensure_valid
raise QtValueError(obj)
qutebrowser.utils.qtutils.QtValueError: PyQt5.QtCore.QRegularExpression('data:text/html;charset=UTF\\-8,<%21DOCTYPE.*html>%0A<%21\\-\\-%0Avim%3A.*ft%3Dhtml.*fileencoding%3Dutf\\-8.*sts%3D4.*sw%3D4.*et%3A%0A\\-\\->%0A%0A<html>%0A.*<head>%0A.*<meta.*charset%3D"utf\\-8">%0A.*<title>Error.*loading.*page%3A.*https%3A%2F%2F63c0329c\\-93f0\\-46c4\\-a395\\-4821275f9646\\.idocker\\.vuln\\.land%2Fcat%2Ffiles%2Ftest<%2Ftitle>%0A.*<style.*type%3D"text%2Fcss">%0A.*%0A%0A.*body.*\\{%0A.*margin%3A.*0%3B%0A.*padding%3A.*0%3B%0A.*\\}%0A.*%0A%2A.*\\{%0A%09margin%3A.*0px.*0px%3B%0A%09padding%3A.*0px.*0px%3B%0A\\}%0A%0Abody.*\\{%0A%09font\\-family%3A.*"Helvetica.*Neue"%2C.*Helvetica%2C.*Arial%2C.*sans\\-serif%3B%0A%09\\-webkit\\-text\\-size\\-adjust%3A.*none%3B%0A%09color%3A.*%23333333%3B%0A%09background\\-color%3A.*%23EEEEEE%3B%0A%09font\\-size%3A.*1\\.2em%3B%0A\\}%0A%0A%23error\\-container.*\\{%0A%09margin\\-left%3A.*20px%3B%0A%09margin\\-right%3A.*20px%3B%0A%09margin\\-top%3A.*20px%3B%0A%09border%3A.*1px.*solid.*%23CCCCCC%3B%0A%09box\\-shadow%3A.*0px.*0px.*6px.*rgba%280%2C.*0%2C.*0%2C.*0\\.20%29%3B%0A%09border\\-radius%3A.*5px%3B%0A%09background\\-color%3A.*%23FFFFFF%3B%0A%09padding%3A.*20px.*20px%3B%0A\\}%0A%0A%23header.*\\{%0A%09border\\-bottom%3A.*1px.*solid.*%23CCC%3B%0A\\}%0A%0A\\.qutebrowser\\-broken.*\\{%0A%09display%3A.*block%3B%0A%09width%3A.*100%25%3B%0A\\}%0A%0Atd.*\\{%0A%09margin\\-top%3A.*20px%3B%0A%09color%3A.*%23555%3B%0A\\}%0A%0Ah1.*\\{%0A%09font\\-weight%3A.*normal%3B%0A%09color%3A.*%231e89c6%3B%0A%09margin\\-bottom%3A.*10px%3B%0A\\}%0A%0Aul.*\\{%0A%09margin\\-left%3A.*20px%3B%0A%09margin\\-top%3A.*20px%3B%0A%09margin\\-bottom%3A.*20px%3B%0A\\}%0A%0Ali.*\\{%0A%09margin\\-top%3A.*10px%3B%0A%09margin\\-bottom%3A.*10px%3B%0A\\}%0A%0A.*<%2Fstyle>%0A.*<script.*type%3D"text%2Fjavascript">%0A.*%0A%0A.*%0Afunction.*tryagain%28%29%0A\\{%0A.*location\\.href.*%3D.*"https%3A%2F%2F63c0329c\\-93f0\\-46c4\\-a395\\-4821275f9646\\.idocker\\.vuln\\.land%2Fcat%2Ffiles%2Ftest"%3B%0A\\}%0A%0A.*<%2Fscript>%0A.*<%2Fhead>%0A.*<body>%0A.*%0A<div.*id%3D"error\\-container">%0A%09<table>%0A%09%09<tr>%0A%09%09%09<td.*style%3D"width%3A.*10%25%3B.*vertical\\-align%3A.*top%3B">%0A%09%09%09%09<img.*style%3D"width%3A.*100%25%3B.*display%3A.*block%3B.*max\\-width%3A.*256px%3B".*src%3D"data%3Aimage%2Fpng%3Bbase64%2C<base64 data 1>', PyQt5.QtCore.QRegularExpression.PatternOptions(1)) is not valid: regular expression is too large

# Fixed code
def set_pattern(self, val):
    """Setter for pattern.

    Args:
        val: The value to set.
    """
    if len(val) > 5000:  # avoid crash on huge search terms (#5973)
        log.completion.warning(f"Trimming {len(val)}-char pattern to 5000")
        val = val[:5000]
    self._pattern = val
    val = re.sub(r" +", r" ", val)  # See #1919
    val = re.escape(val)
    val = val.replace(r"\ ", ".*")
    rx = QRegularExpression(val, QRegularExpression.CaseInsensitiveOption)
    qtutils.ensure_valid(rx)
    self.setFilterRegularExpression(rx)
    self.invalidate()
    sortcol = 0
    self.sort(sortcol)