Hello @daidaiworm, and All,
I could not post anything for a while, due to some “Guru meditation...” ! In the meantime, You’ve got, from @Scott-sumner, the right solution :-)) I exactly thought about the same regex S/R. Here is my initial post, which was ready… to be moved on line !
I didn’t test the column mode feature, while building macros, but I would use, instead, a macro based on a search/replacement operation.
So, if you replace your macro block, in the shortcuts.xml file, with the following block :
<Macro name="nppMacro_eric" Ctrl="no" Alt="no" Shift="no" Key="0">
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s).+" />
<Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
<Action type="3" message="1602" wParam="0" lParam="0" sParam="\($0\)" />
<Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
<Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
</Macro>
you should obtain a reliable macro and expected results :-))
Notes :
The 1601 message initialize the search/replacement operation
The search regex (?-s).+ is inserted at the end of the 1601 message and search for the greatest range of standard characters so all line contents, without its line-break
The number 2, in message 1625, means that search is performed, in regular expression mode
The replacement regex \($0\) is inserted at the end of the 1602 message and rewrites a literal ( symbol, then all the search match ( $0 ) and, finally, the literal ) symbol
The flag number 768, in message 1702, represents the sum 512 ( Down direction) + 256 ( Wrap around )
The command number 1609, in message 1701, stands for a hit on the Replace All button
Best Regards,
guy038
P.S. :
For a
complete list of the
search /replace encoding, in the
shortcuts.xml file, refer to the link, below :
http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#Search_.2F_Replace_encoding
Note that the flag value 512 means Search goes downwards ( and not upwards ! )
Be aware that when you use the command value 1614 ( Count ), the Find dialog must have been previously opened !