[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: search and replace to upper/lower case
From: |
Benno Schulenberg |
Subject: |
Re: search and replace to upper/lower case |
Date: |
Thu, 15 Oct 2020 16:15:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello Carlo,
Op 15-10-2020 om 15:07 schreef carlo:
> i can't get regex search and replace to change text case from lower to upper
>
> \U and \L won't work with something like \U\1 in the replace-with string -- i
> may be failing the syntax
When you read 'info sed sed the', you will see than \L and \U are GNU sed
extensions. Other tools (and nano) do not know these backslash escapes.
> i can do it by ^T and using sed as external command, but i have to enter the
> text string myself, like:
>
> sed 's/^.*$/\U&/' <<< "uppercase me"
You can make a string bind in your .nanorc, for example:
bind Sh-M-U "^T|sed 's/^.*$/\U&/'^M" main
(where ^T and ^M are literal control characters, entered with M-V).
Restart nano, select the text you want to upcase, and hit Shift+Alt+U.
[Please answer to the list, not to me.]
Benno
signature.asc
Description: OpenPGP digital signature