(([a-z]{2})[a-z]*) ([0-9]+):([0-9]+) The name of the book is in \1, the first two letters are in \2, and then the reference is in \3:\4
However, this does require that the name of the book be at least two letters long. Dave On Feb 22, 2010, at 8:08 AM, Philip Juel Borges wrote: > Hi, > > Xcode supports the use of regular expressions. With the following search and > replace I can find a string, like John 17:17, and turn it into a link: > > Find > ([a-z]+) ([0-9]+):([0-9]+) > > Replace > <a href="file:///Library/\1/\2.html#\3">\1 \2:\3</a> > > This works fine. But right after Library I want to insert another folder > comprised of the first two letters of John. So after the search and replace > I'd like to get: > > <a href="file:///Library/Jo/17.html#17">John 17:17</a> > > Is it possible in the replace field to extract the first two letters of the > first pattern, i.e., ([a-z]+)? > > --Philip
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com