6V8 - Production of my Mind

Home page > Outdated > Contributing Dashboard > Regexpchainer

Regexpchainer

 
I wanted a chainer to send KEYWORD clues extracted from google queries received as URL clues. Like most of the existing chainer, this is a regular expression work: cut the URL string to keep the keyword. Hence I said to myself: make a chainer that will take any regular expression and a clue to chain the extracted substring to another clue type.
backend chainer | 18 November 2003, by Mortimer

The regexpchainer is there for this purpose, it take in a configuration file " /.dashboard/backend-data/regexchainer/config.xml" a list of regular expression and what should be done with them.

You can specify chain in two ways:


<Chain Type="url" Regexp="http://www.google.com/search\?&q=(.*)">

that will chain all clue from URL type to KEYWORD. extracting anything after the "q=" in a google query.


<Chain From="textblock" To="measure" Regex="(\b\d+((.|,)\d+)? ?oF)\b" Ignore="2,3"/>

will extract Fahrenheit MEASURE from TEXBLOCK.

if no Type attribute is specified, the parser expect the From and To tags; if Type is specified, KEYWORD clues will be generated. The regexp is in Perl5 format (the one supported by mono). Each group (between parentheses) will generate a new clue, except the one specified in the Ignore attribute. (Note that there is no group 0)

everything between quote should be escaped (& => &)

(actually the conversion backend relies on this chainer to extract measure)

Date of online publication: 18 November 2003
last-update: 20 November 2003
Forum messages 0
visits:
1681

Creative Commons Attribution NonCommercial ShareAlike 2.5  License
 

Reply to this article

 

The most read articles

Photos On Flickr

 
©
Pierre Andrews
York, uk
| Site Map | Site created with SPIP 1.9.2d [11132] | RSS | template by IZO, Mortimer. |
Fernando tiramisu authors before the
Fernando tiramisu authors before the
Fernando tiramisu authors before the
Fernando tiramisu authors before the
Fernando tiramisu authors before the