grab an id tag and copy paste it somewhere else

A place to try and solve your RegEx problems.
Post Reply
maxdido
Posts: 4
Joined: Sun Apr 01, 2012 9:20 am

grab an id tag and copy paste it somewhere else

Post by maxdido »

I have the following code:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<movie>
    <title>Abraham Lincoln: Vampire Hunter</title>
    <year>2012</year>
    <thumb>nfs://192.168.1.3/volume2/HD2-Movies/fanart/Abraham Lincoln - Vampire Hunter[Cover].jpg</thumb>
    <fanart>
      <thumb>nfs://192.168.1.3/volume2/HD2-Movies/fanart/Abraham Lincoln - Vampire Hunter[Backdrop].jpg</thumb>
    </fanart>
    <playcount>1</playcount>
    <id>tt1611224</id>
</movie>
http://www.imdb.com/title//
How to grab the id tag, tt1611224 , and copy/paste it in between the // at the end of my code so I get : http://www.imdb.com/title/tt1611224/
maxdido
Posts: 4
Joined: Sun Apr 01, 2012 9:20 am

Re: grab an id tag and copy paste it somewhere else

Post by maxdido »

I found the solution.
In the reg ex line I added:

Code: Select all

(<movie>)\r\n
    (<title>*.*</title>)\r\n
    (<year>*.*</year>)\r\n
    (<thumb>*.*</thumb>)\r\n
    (<fanart>)\r\n
      (<thumb>*.*</thumb>)\r\n
    (</fanart>)\r\n
    (<playcount>*.*</playcount>)\r\n
    (<id>*.*</id>)\r\n
(</movie>)\r\n
http://www.imdb.com/title//
And in the Replace line I added:

Code: Select all

$1
    $2
    $3
    $4
    $5
      $6
    $7
    $8
    $9
$10
http://www.imdb.com/title/$9/
Then after the replace I just had to replace /<id> and </id>/ with a / to get rid of the id tags.
Post Reply