Page 1 of 1

when replacing both case and content

Posted: Sat Oct 29, 2011 11:39 pm
by redcairo
In the help file it showed that I could search for content and replace it with upper or lowercase (in whole or part) using backslash "u" or "U" with ampersand. This works great.

But I can't figure out what to do when I have to specify the \# of a paren value I am replacing, at the same time I am specifying the case change of its content.

For example, I have multiple choice question/answers where the response looks like this (letter at start of line could be A-F):

A. Correct, something else here.

I need to change it to say:

a. Correct. Something else here.

So the option letter changed at front, and the capitalization changed on the first letter of the now-a-new-sentence that follows.

I don't understand how to mix the (content) \1 and the (content) \l& elements.

I'd sure appreciate some advice! Thanks!

PJ

Posted: Sun Oct 30, 2011 10:22 am
by ak47wong
Use \u\n or \l\n to change the case of the first letter of the backreferenced string. Or use \U\n\E or \L\n\E to change the case of the entire backreferenced string.

For your example:

Find what: ([^,]*),_(.*) [substitute a space for the underscore]
Replace with: \l\1._\u\2 [substitute a space for the underscore]

Enable POSIX regular expression syntax in Configure > Preferences > Editor.

Posted: Mon Oct 31, 2011 12:38 am
by redcairo
I see -- so you just use the case function first then the replace and it "knows." Thank you very much!

PJ