• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Regular Expressions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regular Expressions


  • Subject: Regular Expressions
  • From: Philip Juel Borges <email@hidden>
  • Date: Mon, 22 Feb 2010 14:08:26 +0100

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
_______________________________________________

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


  • Follow-Ups:
    • Re: Regular Expressions
      • From: Jens Alfke <email@hidden>
    • Re: Regular Expressions
      • From: Dave DeLong <email@hidden>
  • Prev by Date: Re: Determine if only single instance is running.
  • Next by Date: Re: Removing quit button from dock menu
  • Previous by thread: Re: Removing quit button from dock menu
  • Next by thread: Re: Regular Expressions
  • Index(es):
    • Date
    • Thread