Mozilla Skin
Translate this page


Parse Node

From Moving Pictures

The parse node is what you would use to look through something for some information. This is done through regular expressions. Please review the following table for a list of attributes associated with this node.

Attribute description
name This is a required attribute that defines the return variable of this node.
input This is a required attribute that defines the input variable/string to run the regular expression against.
regex This is a required attribute that defines the regular expression to use.

Example

<parse name="details_page_block" input="${search_page}" regex="${rx_search_results}"/>


Return variable

Often a regular expression will turn up more than one result especially when you are searching for movies. That is why the parse node returns an array of results. Lets say that the regular expression in the example returns 4 items per result. The regular expression returns the following: Title, Year, IMDb ID, and details page in that order. If you wanted to get the first result's year you would call this: ${details_page_block[0][1]} The parse node returns a two dimensional array where the first dimension is the result index and the second dimension is the index of the items returned by the regex.