search(text = this.input.value) {
    if (!text || text === '') {
      this.resetForm();
      return;
    }

    try {
      const regex = new RegExp(text.replace(/\//, ''));

      this.resultsList.querySelectorAll('.message').forEach(element => {
        const match = element.textContent.match(regex);

        this.hideError();

        let matchContainer = null;

        if (element.nextElementSibling && element.nextElementSibling.classList.contains('pr-match')) {
          matchContainer = element.nextElementSibling;
        }

        if (match) {
          if (!matchContainer) {
            matchContainer = document.createElement('span');
            matchContainer.classList.add('pr-match');
            element.insertAdjacentElement('afterEnd', matchContainer);
          }

          matchContainer.style.display = 'inline';
          matchContainer.textContent = match[1];
          element.style.display = 'none';
        }
        else {
          element.style.display = 'inline';

          if (matchContainer) {
            matchContainer.style.display = 'none';
          }
        }
      });
    }
    catch(err) {
      this.showError();
      throw err;
    }
  }
/**
   * Searches among the list of papertrail results and displays the ones matching
   * the provided regular expression
   *
   * @param {string} text
   */
Searches among the list of papertrail results and displays the ones matching
the provided regular expression

@param {string} text
Searches among the list of papertrail results and displays the ones matching the provided regular expression @param { string } text
search(text = this.input.value) {
    if (!text || text === '') {
      this.resetForm();
      return;
    }
    try {
      const regex = new RegExp(text.replace(/\//, ''));
      this.resultsList.querySelectorAll('.message').forEach(element => {
        const match = element.textContent.match(regex);
        this.hideError();
        let matchContainer = null;
        if (element.nextElementSibling && element.nextElementSibling.classList.contains('pr-match')) {
          matchContainer = element.nextElementSibling;
        }
        if (match) {
          if (!matchContainer) {
            matchContainer = document.createElement('span');
            matchContainer.classList.add('pr-match');
            element.insertAdjacentElement('afterEnd', matchContainer);
          }
          matchContainer.style.display = 'inline';
          matchContainer.textContent = match[1];
          element.style.display = 'none';
        }
        else {
          element.style.display = 'inline';
          if (matchContainer) {
            matchContainer.style.display = 'none';
          }
        }
      });
    }
    catch(err) {
      this.showError();
      throw err;
    }
  }
search ( text = this . input . value ) { if ( ! text || text === '' ) { this . resetForm ( ) ; return ; } try { const regex = new RegExp ( text . replace ( / \/ / , '' ) ) ; this . resultsList . querySelectorAll ( '.message' ) . forEach ( element => { const match = element . textContent . match ( regex ) ; this . hideError ( ) ; let matchContainer = null ; if ( element . nextElementSibling && element . nextElementSibling . classList . contains ( 'pr-match' ) ) { matchContainer = element . nextElementSibling ; } if ( match ) { if ( ! matchContainer ) { matchContainer = document . createElement ( 'span' ) ; matchContainer . classList . add ( 'pr-match' ) ; element . insertAdjacentElement ( 'afterEnd' , matchContainer ) ; } matchContainer . style . display = 'inline' ; matchContainer . textContent = match [ 1 ] ; element . style . display = 'none' ; } else { element . style . display = 'inline' ; if ( matchContainer ) { matchContainer . style . display = 'none' ; } } } ) ; } catch ( err ) { this . showError ( ) ; throw err ; } }
Searches among the list of papertrail results and displays the ones matching
 the provided regular expression
Searches among the list of papertrail results and displays the ones matching the provided regular expression