Re: Regular Expressions
Re: Regular Expressions
- Subject: Re: Regular Expressions
- From: Dave DeLong <email@hidden>
- Date: Mon, 22 Feb 2010 08:57:57 -0500
(([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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden