Regular Expressions Problem (Windows vs. Xbox)
#1
Is there a known difference in the way the various versions of XBMC implement Regular Expressions?

When my script runs the following match:

match=re.compile('<li><a href=\'(.+)\' title=\'(.+)\'>(.+)</a></li>').findall(link)

on the following string:

<li><a href='http://tv.winelibrary.com/2009/01/' title='January 2009'>January 2009</a></li>

I get different results:

Windows = January 2009 (Desired Result)

Xbox = January (2009) (Where are the ()'s from?)

Windows = XBMC SVN: Unknown (Compiled: Oct 6 2008)

Xbox = pre-9.04 (Compiled: Jan 25 2009)

Thanks,

Jeff
Reply
#2
Has nothing to do with XBMC, python does its own thing as far as REs go, and all version of XBMC use the same python. I'd check that the haystack is actually what you expect on both platforms (no clue why it wouldn't be different) and/or use a less greedy expression.
Reply
#3
I've seen this happen too (and went through a period of what's up with this regular expression engine). The trick seems to be that it is not a difference in the regular expression engine rather it appears that there is some code on the xbox associated with listitems that looks for dates at the end of items and does some special processing.
I had dates converted only on xbox too e.g. 2009-02-07 to (2009) . The hack I used was to change the date seperator when running xbox (works just fine on windows with latest SVN build for me).

Cheers
Dink

afishe2000 Wrote:Is there a known difference in the way the various versions of XBMC implement Regular Expressions?

When my script runs the following match:

match=re.compile('<li><a href=\'(.+)\' title=\'(.+)\'>(.+)</a></li>').findall(link)

on the following string:

<li><a href='http://tv.winelibrary.com/2009/01/' title='January 2009'>January 2009</a></li>

I get different results:

Windows = January 2009 (Desired Result)

Xbox = January (2009) (Where are the ()'s from?)

Windows = XBMC SVN: Unknown (Compiled: Oct 6 2008)

Xbox = pre-9.04 (Compiled: Jan 25 2009)

Thanks,

Jeff
-----------------------------------------
BBC IPlayer[url=http://drop.io/xbmcdink][/url] Plugin
Reply

Logout Mark Read Team Forum Stats Members Help
Regular Expressions Problem (Windows vs. Xbox)0