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

Breadcrumb

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

function Parser::preg_match

A local wrapper for "preg_match" which will throw a ParseException if there is an internal error in the PCRE engine.

This avoids us needing to check for "false" every time PCRE is used in the YAML engine

@internal

Throws

ParseException on a PCRE internal error

11 calls to Parser::preg_match()
Inline::dump in vendor/symfony/yaml/Inline.php
Dumps a given PHP variable to a YAML string.
Inline::evaluateBinaryScalar in vendor/symfony/yaml/Inline.php
Inline::evaluateScalar in vendor/symfony/yaml/Inline.php
Evaluates scalars and replaces magic values.
Inline::parseMapping in vendor/symfony/yaml/Inline.php
Parses a YAML mapping.
Inline::parseQuotedScalar in vendor/symfony/yaml/Inline.php
Parses a YAML quoted scalar.

... See full list

File

vendor/symfony/yaml/Parser.php, line 1053

Class

Parser
Parser parses YAML strings to convert them to PHP arrays.

Namespace

Symfony\Component\Yaml

Code

public static function preg_match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int {
    if (false === ($ret = preg_match($pattern, $subject, $matches, $flags, $offset))) {
        throw new ParseException(preg_last_error_msg());
    }
    return $ret;
}

API Navigation

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