Welcome to WebmasterWorld Guest from 54.196.233.239

Forum Moderators: bakedjake

Message Too Old, No Replies

What regular expression would I use to find+replace this text?

     

uplius

2:30 am on Apr 26, 2010 (gmt 0)

5+ Year Member



Hello, I've been trying to move my iTunes library from my PC to my mac, which also means that I'll have to be changing every entry in the itunes library xml file from the file path using forward slashes "/" to that of using colons ":". I'm a newbie at regular expressions and I need this library moved really soon. Can you help me write a regular expression?
This is an example of what it currently says:
<string>file://localhost/F:/iTunes Music/artist/album/track.m4a</string>
And this is what I want it to say:
<string>Macintosh HD:Users:user:Music:iTunes:Music:artist:album:track.m4a</string>

Thank you!

lammert

10:14 am on Apr 26, 2010 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



A regular expression is something that matches a piece of text, not replace it. Replacement is a feature of an editor or program and the syntax differs for the different editors. Some editors do take regular expressions as input though. Can you give more information about the editor which you want to use to do this replacement?

uplius

4:48 pm on Apr 26, 2010 (gmt 0)

5+ Year Member



Yes, I'm using Textmate and it supports regular expressions. I remember very little about regular expressions, but I believe that when I wrote an Apache htaccess file a while ago, I could use some variable like $1 and $2. Couldn't I put in the find section to draw out, say, the artist as $1 and then in the replace section just fill in $1 in between the colons?

lammert

6:01 am on Apr 28, 2010 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Unfortunately I have no experience with Textmate. Hopefully another member with more experience in this area will jump in.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month