Etc : Nano - where is
Search and Replace
Back to my_help.txt and the next topic is Search for a string or regular expression which is on line 46, so select that line and do a Ctrl+K to Cut it.
These shortcuts are in Section 4: and to get there quickly do Ctrl+W Where Is and in Search: type in 4: and hit Enter..

The cursor should be at the beginning of 4:. hit the End Key and then do Ctrl+U to paste in the heading.
There are other commands in the Where is menu, so lets play with them!!
Do another search again Ctrl+W this time for Cur and Enter, you will get a match for current do Alt+W to search forward to get more matches for current and for cursor, one for Cursor and two for occurrence. Search Wrapped will pop up when you have found the last occurrences and then starts over again. Try Alt+Q to search backwards
Searches can be tweaked such as making them Case Sensitive, Hit Ctrl+W again, the current search is shown in brackets then do Alt+C to make the search case sensitive and Enter. There will only be one occurrence Cursor.
Alt+R will search using Regular Expressions, for the inner geek in you try this simple one to search for words beginning with Cur type in \bCur the \b means the beginning of a word this will bring up all the hits for current and cursor but not for occurrence. Then do Alt+C for a case-sensitive search and again only one hit.

In the Where Is menu there is the Replace Command Ctrl+R which searches for text and replaces it. This command is also available from the main help menu as Ctrl+\.
This will bring up Search (to replace), with the last search in brackets. If search is set to be [Case Sensitive] do Alt+C to cancel that and if set as a Regular Expression [Regexp] do Alt+R to cancel that.
I copied the Search and Replace commands but never got around replacing ^ with Ctrl+ and M- with Alt+, not to worry, you can do that, so in Search (to replace) type in ^ Shift key + 6 and hit Enter.

In Replace with: type in Ctrl+ and hit Enter and when prompted for Replace this instance? hit A for All
Nano will work its magic and the status bar will say how many occurrences have been replaced, now replace M- with Alt+!!!
Nano remembers all your previous searches and replaces, when you are in that mode use your up and down arrow keys to scroll through them or else Ctrl+P for Older (Past) and Ctrl+N for Newer search and replaces.
If you do an Alt+A Mark Set and select part of a file before you do a Search/Replace, nano will only Search/Replace in that selection.