dom.pattern

Classes

goog.dom.pattern.AbstractPattern
Base pattern class for DOM matching.
goog.dom.pattern.AllChildren
Pattern object that matches any nodes at or below the current tree depth.
goog.dom.pattern.ChildMatches
Pattern object that matches any nodes at or below the current tree depth.
goog.dom.pattern.EndTag
Pattern object that matches a closing tag.
goog.dom.pattern.FullTag
Pattern object that matches a full tag including all its children.
goog.dom.pattern.Matcher
Given a set of patterns and a root node, this class tests the patterns in parallel. It is not (yet) a smart matcher - it doesn't do any advanced backtracking. Given the pattern DIV, SPAN the matcher will not match DIV, DIV, SPAN because it starts matching at the first DIV, fails to match SPAN at the second, and never backtracks to try again. It is also possible to have a set of complex patterns that when matched in parallel will miss some possible matches. Running multiple times will catch all matches eventually.
goog.dom.pattern.NodeType
Pattern object that matches any node of the given type.
goog.dom.pattern.Repeat
Pattern object that matches a repetition of another pattern.
goog.dom.pattern.Sequence
Pattern object that matches a sequence of other patterns.
goog.dom.pattern.StartTag
Pattern object that matches an opening tag.
goog.dom.pattern.Tag
Pattern object that matches an tag.
goog.dom.pattern.Text
Pattern object that matches text by exact matching or regular expressions.

Public Protected Private

Enumerations

goog.dom.pattern.MatchType :
When matched to a token, a pattern may return any of the following statuses:
  1. NO_MATCH - The pattern does not match. This is the only value that evaluates to false in a boolean context.
  2. MATCHING - The token is part of an incomplete match.
  3. MATCH - The token completes a match.
  4. BACKTRACK_MATCH - The token does not match, but indicates the end of a repetitive match. For instance, in regular expressions, the pattern /a+/ would match 'aaaaaaaab'. Every 'a' token would give a status of MATCHING while the 'b' token would give a status of BACKTRACK_MATCH.
Constants:
BACKTRACK_MATCH
No description.
MATCH
No description.
MATCHING
No description.
NO_MATCH
No description.
Code »

Global Functions

goog.dom.pattern.matchStringOrRegex(objstr) boolean
Utility function to match a string against either a string or a regular expression.
Arguments:
obj : string | RegExp
Either a string or a regular expression.
str : string
The string to match.
Returns: boolean  Whether the strings are equal, or if the string matches the regular expression.
code »
goog.dom.pattern.matchStringOrRegexMap(elemindexorig) boolean
Utility function to match a DOM attribute against either a string or a regular expression. Conforms to the interface spec for goog.object#every.
Arguments:
elem : string | RegExp
Either a string or a regular expression.
index : string
The attribute name to match.
orig : Object
The original map of matches to test.
Returns: boolean  Whether the strings are equal, or if the attribute matches the regular expression.
code »

Global Properties

goog.dom.pattern.BREAKING_TEXTNODE_RE :
Regular expression for breaking text nodes.
Code »
goog.dom.pattern.callback :
No description.
Code »
goog.dom.pattern.matcherTest :
No description.
Code »

Package dom

Package Reference