PHP 클래스 League\CommonMark\Util\RegexHelper

Singletons are generally bad, but it allows us to build the regexes once (and only once).
파일 보기 프로젝트 열기: colinodell/commonmark-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$instance
$regex

공개 메소드들

메소드 설명
getHtmlBlockCloseRegex ( integer $type ) : string | null
getHtmlBlockOpenRegex ( integer $type ) : string | null
getHtmlTagRegex ( ) : string
getInstance ( ) : RegexHelper
getLinkDestinationBracesRegex ( ) : string
getLinkDestinationRegex ( ) : string
getLinkTitleRegex ( ) : string
getPartialRegex ( integer $const ) : string Returns a partial regex
getThematicBreakRegex ( ) : string
isLinkPotentiallyUnsafe ( string $url ) : boolean
matchAll ( string $pattern, string $subject, integer $offset ) : array | null Functional wrapper around preg_match_all
matchAt ( string $regex, string $string, integer $offset ) : integer | null Attempt to match a regex in string s at offset offset
unescape ( string $string ) : string Replace backslash escapes with literal characters

보호된 메소드들

메소드 설명
__construct ( ) Constructor
buildRegexPatterns ( ) Builds the regular expressions required to parse Markdown

메소드 상세

__construct() 보호된 메소드

Constructor
protected __construct ( )

buildRegexPatterns() 보호된 메소드

We could hard-code them all as pre-built constants, but that would be more difficult to manage.
protected buildRegexPatterns ( )

getHtmlBlockCloseRegex() 공개 정적인 메소드

public static getHtmlBlockCloseRegex ( integer $type ) : string | null
$type integer HTML block type
리턴 string | null

getHtmlBlockOpenRegex() 공개 정적인 메소드

public static getHtmlBlockOpenRegex ( integer $type ) : string | null
$type integer HTML block type
리턴 string | null

getHtmlTagRegex() 공개 메소드

public getHtmlTagRegex ( ) : string
리턴 string

getInstance() 공개 정적인 메소드

public static getInstance ( ) : RegexHelper
리턴 RegexHelper

getLinkDestinationBracesRegex() 공개 메소드

getLinkDestinationRegex() 공개 메소드

public getLinkDestinationRegex ( ) : string
리턴 string

getLinkTitleRegex() 공개 메소드

public getLinkTitleRegex ( ) : string
리턴 string

getPartialRegex() 공개 메소드

It'll need to be wrapped with /.../ before use
public getPartialRegex ( integer $const ) : string
$const integer
리턴 string

getThematicBreakRegex() 공개 메소드

public getThematicBreakRegex ( ) : string
리턴 string

isLinkPotentiallyUnsafe() 공개 정적인 메소드

public static isLinkPotentiallyUnsafe ( string $url ) : boolean
$url string
리턴 boolean

matchAll() 공개 정적인 메소드

Functional wrapper around preg_match_all
public static matchAll ( string $pattern, string $subject, integer $offset ) : array | null
$pattern string
$subject string
$offset integer
리턴 array | null

matchAt() 공개 정적인 메소드

Attempt to match a regex in string s at offset offset
public static matchAt ( string $regex, string $string, integer $offset ) : integer | null
$regex string
$string string
$offset integer
리턴 integer | null Index of match, or null

unescape() 공개 정적인 메소드

Replace backslash escapes with literal characters
public static unescape ( string $string ) : string
$string string
리턴 string

프로퍼티 상세

$instance 보호되어 있는 정적으로 프로퍼티

protected static $instance

$regex 보호되어 있는 프로퍼티

protected $regex