RegexParserUtils

TheArtOfDev.HtmlRenderer.Core.Parse

Collection of regular expressions used when parsing

メソッド

GetCssAtRules(string, int) : string

Get CSS at rule from the given stylesheet.

stylesheet
the stylesheet data to retrieve the rule from
startIdx
the index to start the search for the rule, on return will be the value of the end of the found rule

戻り値: the found at rule or null if not exists

GetRegex(string) : Regex

Get regex instance for the given regex string.

regex
the regex string to use

戻り値: the regex instance

Match(string, string) : MatchCollection

Extracts matches from the specified source

regex
Regular expression to extract matches
source
Source to extract matches

戻り値: Collection of matches

Search(string, string) : string

Searches the specified regex on the source

regex
source
Search(string, string, int) : string

Searches the specified regex on the source

regex
source
position

フィールド

CssBlocks : string

Extracts defined blocks in CSS. WARNING: Blocks will include blocks inside at-rules.

CssFontFamily : string

Extracts font-family values

CssFontSize : string

Exracts font sizes: xx-small, larger, small, 34pt, 30%, 2em

CssFontSizeAndLineHeight : string

Gets the font-size[/line-height]? on the font shorthand property. Check http://www.w3.org/TR/CSS21/fonts.html#font-shorthand

CssFontStyle : string

Extracts CSS font-styles; e.g. normal italic oblique

CssFontVariant : string

Extracts CSS font-variant values; e.g. normal, small-caps

CssFontWeight : string

Extracts font-weight values; e.g. normal, bold, bolder...

CssLength : string

Extracts CSS lengths; e.g. 9px 3pt .89em

CssLineHeight : string

Extracts line-height values (normal, numbers, lengths, percentages)

CssMediaTypes : string

Extracts the media types from a media at-rule; e.g. @media print, 3d, screen {

CssNumber : string

Extracts a number; e.g. 5, 6, 7.5, 0.9

CssPercentage : string

Extracts css percentages from the string; e.g. 100% .5% 5.4%

_regexes : Dictionary<string, Regex>

the regexes cache that is used by the parser so not to create regex each time