src/Str.php
public function matches($pattern, $caseSensitive = true)
	{
		$regex = $this->toRegex($pattern, ($caseSensitive ? "" : Modifiers::CASELESS ));

		return $regex->matches($this);
	}
public function matches($pattern, $caseSensitive = true)
	{
		$regex = $this->toRegex($pattern, ($caseSensitive ? "" : Modifiers::CASELESS ));

		return $regex->matches($this);
	}
public function matches ( $ pattern , $ caseSensitive = true ) { $ regex = $ this -> toRegex ( $ pattern , ( $ caseSensitive ? "" : Modifiers :: CASELESS ) ) ; return $ regex -> matches ( $ this ) ; }
Determine if the string matches the given regex pattern.

Unless the case-less modifier is set on the pattern, the comparison is
case-sensitive. This can be changed by passing $caseSensitive to FALSE.

@param  string|\Tea\Contracts\Regex\RegularExpression  $pattern
@param  bool                                           $caseSensitive

@return bool
Determine if the string matches the given regex pattern .