I think this would do the job.
1. Open the
Find panel;
2. Set
Using to
PowerFind Pro;
3. In the
Find What field, type this:
4. In the
Replace with field, type this:
5. Hit the
Replace All button (the underscores will be removed but words and phrases embraced by them will remain selected);
6. Activate the document window by closing the
Find panel or by clicking on the document window’s Toolbar;
7. Hit
command-i (Italic).
( . . . ) : captured group
[^_\s] : negative set matching any character which is not _ nor \s (whitespace character)
+ : one or more times
\s : whitespace character, i.e. space, no-break space, return, etc.
(?: . . . ) : non-captured group
* : zero or more times
\1 : back reference to the 1st captured group
boblines wrote:Is this language easily learned, what is it called, and where to I go to learn about it?
It is called Regular Expression. There are several dialects. The one used in NW is almost the same as Perl’s. Many on-line tutorials are available. Personally I find this one nice.
http://www.regular-expressions.info/tutorialcnt.html
but perhaps it is overkilling. You don’t need to learn all lessons. With the first four or five mastered to some degree, you would be able to facilitate many daily tasks, I think.
With Nisus Writer Express/Pro, it is rather easy to learn the Regular Expression. Its
Find All works as
Find and Select All. This means that you can test your expression on many sample texts at once and see all results with a single glance. That is a great advantage for learners of the Regular Expression.
Edit: The find expression above (step 3) is somewhat complicated. This is so because I don’t know your documents exactly. The following is expected to work as well.
. : any character except return (LF)
+? : shortest one or more times