XBMC Community Forum
Variables in expression or conditional regex? - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Scraper Development (/forumdisplay.php?fid=60)
+--- Thread: Variables in expression or conditional regex? (/showthread.php?tid=97882)



Variables in expression or conditional regex? - mbosner - 2011-03-27 22:12

Is it possible to use variables in expressions? e.g.:

PHP Code:
<RegExp input="$$4" output="<entity><title>\2</title><year>\3</year><url>http://www.imdb.de/title/\1/</url><id>\1</id></entity>" dest="3+">
    <
RegExp input="$$1" output="\1" dest="6">
        <
expression noclean="1">>input id="navbar-query" name="q" type="text" value=".*\(([0-9]+)\)"<</expression>
    </
RegExp>
    <
expression repeat="yes" noclean="1,2">><a href="/title/([t0-9]*)/[^>]*>([^<]*)</a> *\(($$6)\)</expression>
</RegExp> 
Here i tried to use $$6 within the expression.

And is it possible to create regex that will only run if a nested regex hits?

I am stuck !


- mbosner - 2011-03-28 02:11

Ok seens that i already asked the first question a year ago.

And it does work Wink