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

Breadcrumb

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

function RegExpLiteral::setRaw

Sets node's raw value that must include delimiters

Parameters

string $raw Raw value:

Return value

$this

Overrides Literal::setRaw

1 call to RegExpLiteral::setRaw()
RegExpLiteral::setValue in vendor/mck89/peast/lib/Peast/Syntax/Node/RegExpLiteral.php
Sets node's value

File

vendor/mck89/peast/lib/Peast/Syntax/Node/RegExpLiteral.php, line 116

Class

RegExpLiteral
A node that represents a regular expression literal.

Namespace

Peast\Syntax\Node

Code

public function setRaw($raw) {
    $parts = explode("/", substr($raw, 1));
    $flags = array_pop($parts);
    $this->setPattern(implode("/", $parts));
    $this->setFlags($flags);
    return $this;
}
RSS feed
Powered by Drupal