PHP 클래스 ParallelRegex, simpletest

Any of the contained patterns could match and when one does, it's label is returned.
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( boolean $case ) Constructor. Starts with no patterns.
addPattern ( string $pattern, string $label = true ) Adds a pattern with an optional label.
match ( string $subject, string &$match ) : boolean Attempts to match all patterns at once against a string.

보호된 메소드들

메소드 설명
getCompoundedRegex ( ) Compounds the patterns into a single regular expression separated with the "or" operator.
getPerlMatchingFlags ( ) : string Accessor for perl regex mode flags to use.

메소드 상세

__construct() 공개 메소드

Constructor. Starts with no patterns.
public __construct ( boolean $case )
$case boolean True for case sensitive, false for insensitive.

addPattern() 공개 메소드

Adds a pattern with an optional label.
public addPattern ( string $pattern, string $label = true )
$pattern string Perl style regex, but ( and ) lose the usual meaning.
$label string Label of regex to be returned on a match.

getCompoundedRegex() 보호된 메소드

Caches the regex. Will automatically escape (, ) and / tokens.
protected getCompoundedRegex ( )

getPerlMatchingFlags() 보호된 메소드

Accessor for perl regex mode flags to use.
protected getPerlMatchingFlags ( ) : string
리턴 string Perl regex flags.

match() 공개 메소드

Attempts to match all patterns at once against a string.
public match ( string $subject, string &$match ) : boolean
$subject string String to match against.
$match string First matched portion of subject.
리턴 boolean True on success.