Kodi Community Forum

Full Version: GetDetails?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having problems extracting the plot from XML. It seems that the '!' in '<![CDATA[' makes regex go bananas.
How will I go about cutting out the multi line plot?

Current regex:

<Description>([^<]*)</Description>

XML:

Code:
<Description>
<![CDATA[
Arn Magnusson bliver født i 1150 som søn af stormanden Magnus og hans hustru Sigrid. Han bliver opdraget af cisterciensermunkene ved Varnhem Kloster i Västra Götaland og får her den bedste uddannelse, Europa på det tidspunkt kan præstere...
  ]]>
  </Description>


/Tnx
Code:
"<!\\[CDATA\\[(.*?)\\]\\]>"
in python you have to use re.DOTALL
Well this is a scraper and the regex does not seem to do any difference Sad No match
It was escaped too many times.

Try:

Code:
<!\[CDATA\[(.*?)\]\]>
tnx tslayer, I managed to get it working now Smile

Code:
<Description>[^$]*<!\[CDATA\[([^$]*)\]\][^$]*</Description>
Crap! It only worked in regex tester Sad when used in scraperxml tester or XBMC, plot is not set to anything...

Here is the RegExp from GetDetails:

Code:
<RegExp input="$$1" output="&lt;plot&gt;\1&lt;/plot&gt;" dest="5+"><expression>&lt;Description&gt;[^$]*&lt;!\[CDATA\[*([^$]*)\]\][^$]*&lt;/Description&gt;</expression></RegExp>

Any ideas?
Sorry, not sure about scrapers.

Did you try that new scraper program? Maybe that will help.
This seems to work so far, if anyone has the same problem (basicly regex noob) Smile

Code:
<Description>[^<]*<!\[CDATA\[([^<]*)\]\][^<]*</Description>