by Mofi » Mon Mar 06, 2006 3:32 pm
Well, before I start I will inform you, that "search for a word in a file and have the word highlighted in a color" will be available in UltraEdit v12.00. It's already available in v12.00beta2 for the beta testers.
To highlight single-line phrases with the dirty trick you have to add into the wordfile for every language definition you use (/L1"C/C++", /L3"HTML", ...) the following line:
/Marker Characters = "»«"
You can use other characters, but these marker characters should not exist in your files anywhere.
You also have to define this pair of marker characters in an existing or better a new color group at every language where these marker characters are specified. For example:
/C8"Found strings"
»«
That's it. Now all strings in a line starting with » and ending with « will be highlighted with color 8. This method cannot be used for multi-line strings.
For multi-line strings the alternate block comment could be used instead of marker characters. Using alternate block comment has also an additional advantage: instead of a single character to mark the start and end of the search string you can use a real string (with up to 5 characters) for marking the string.
To get all found strings highlighted, you now have to run a replace instead of a find.
Find What: your search string
Replace With: »your search string«
But don't forget to UNDO this replace are run again a replace - a regular expression replace - to remove all »«.
Find What: [»«]
Replace With:
Replace with nothing!