Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Scanner.php

function Scanner::sequenceMatches

Check if upcomming chars match the given sequence.

This will read the stream for the $sequence. If it's found, this will return true. If not, return false. Since this unconsumes any chars it reads, the caller will still need to read the next sequence, even if this returns true.

Example: $this->scanner->sequenceMatches('</script>') will see if the input stream is at the start of a '</script>' string.

Parameters

string $sequence:

bool $caseSensitive:

Return value

bool

File

vendor/masterminds/html5/src/HTML5/Parser/Scanner.php, line 83

Class

Scanner
The scanner scans over a given data input to react appropriately to characters.

Namespace

Masterminds\HTML5\Parser

Code

public function sequenceMatches($sequence, $caseSensitive = true) {
    $portion = substr($this->data, $this->char, strlen($sequence));
    return $caseSensitive ? $portion === $sequence : 0 === strcasecmp($portion, $sequence);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal