Author Topic: Feature Request: Upper/lowercase back reference insert  (Read 3291 times)

greggman

  • Senior Community Member
  • Posts: 273
  • Hero Points: 13
Feature Request: Upper/lowercase back reference insert
« on: September 18, 2009, 10:30:52 pm »
I want to be able to search for _(.)

and replace with _\u1

the upper case version of \1 of what was captured.

Would that be useful to others or is it just me? Maybe this is already there and I didn't notice?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: Feature Request: Upper/lowercase back reference insert
« Reply #1 on: September 21, 2009, 12:41:53 pm »
Case modification on replace text is available on all of the regular expression syntaxes in SlickEdit since 2008 release.

\l  Convert next character lowercase.
\u Convert next character uppercase.
\L Convert all characters lowercase until \E.
\U Convert all characters uppercase until \E.
\Q Quote all characters literally until \E.
\E End all case modification or \Q.

So to uppercase an entire capture group, you would use _\U\1 (from your example).  Currently, the case modifiers only apply to capture groups (\1, \2), but that will probably change in the next release.  Also note if you use the Preserve case option, it override any changes made by case modification.

greggman

  • Senior Community Member
  • Posts: 273
  • Hero Points: 13
Re: Feature Request: Upper/lowercase back reference insert
« Reply #2 on: September 21, 2009, 10:47:27 pm »
Awesome!

Sorry I missed that.

Thank you.