Regular expression case translation
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