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

msg:4121914 | 2:30 am on Apr 26, 2010 (gmt 0) | 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

msg:4122046 | 10:14 am on Apr 26, 2010 (gmt 0) | 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

msg:4122290 | 4:48 pm on Apr 26, 2010 (gmt 0) | 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

msg:4123421 | 6:01 am on Apr 28, 2010 (gmt 0) | Unfortunately I have no experience with Textmate. Hopefully another member with more experience in this area will jump in.
|
|
|