homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

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

 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!



 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?


 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?


 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved