• 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 expression case translation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regular expression case translation


  • Subject: Regular expression case translation
  • From: Daniel Jalkut <email@hidden>
  • Date: Sun, 04 Dec 2005 10:28:57 -0500


I ran into a regex search and replace problem I couldn't solve.

Say you've got a class with dozens of references to these variables:

topFloor
middleFloor
bottomFloor

You want to change them all to be "mTopFloor", "mMiddleFloor", and "mBottomFloor".

I can get close with this regex:

search: (top|middle|bottom)Floor
replace: m\1Floor

But of course the "top|middle|bottom" part remains lower cased.

Is there a trick for getting the substitution to automatically upper- case the first letter of the matched word?

Daniel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Applescript application compiler question
  • Next by Date: Re: Applescript application compiler question
  • Previous by thread: Re: Applescript application compiler question
  • Next by thread: Possible to manipulate file template variable contents?
  • Index(es):
    • Date
    • Thread