Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions PhoneNumberUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -2341,22 +2341,22 @@ public function __construct($pattern, $subject)
* @return bool
*/
public function matches() {
return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0;
return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0;
}

/**
* @return bool
*/
public function lookingAt() {
$this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE);
$this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE);
return $this->fullPatternMatchesNumber > 0;
}

/**
* @return bool
*/
public function find() {
return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0;
return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0;
}


Expand All @@ -2380,11 +2380,11 @@ public function end() {
}

public function replaceFirst($replacement) {
return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject, 1);
return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/x', $replacement, $this->subject, 1);
}

public function replaceAll($replacement) {
return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject);
return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/x', $replacement, $this->subject);
}

public function reset($input = "") {
Expand Down