Is there a way to make the Find instruction apply only on the selected text ? For example I would like to check if the selected text match a regular expression. How can I do that with a macro?
This was so often asked and the answer was always the same: NO (for UE < 14.00).
I have written about a workaround by using Replace All SelectText "..." in macros which can be in some situations used as I have done it several times in my macros - see my sticky forum topic in the macro forum and the documentations in the ZIP archive you can download there.
A workaround is always to copy or cut the selection to a new file and run the finds there.
With the script engine it is now also possible to load a selection into a string variable and run a replace on this variable. I don't know if it is also possible to run a find only on a string variable. Never needed this and so never tried it.
Edit on 2009-10-09: With UltraEdit v14.00 and UEStudio v6.50 and later it is possible to search only in the current selection. But when a string is found in the selection, the selection is discarded and a new selection is made containing only the found string.
Best regards from an UC/UE/UES for Windows user from Austria
Just to answer Mofis question regarding scripts and finds on string variables:
You could for example do something like this: The script checks if a simple SQL date pattern can be found anywhere in a selection and shows a message box with the result:
Sure they can if you by shortcuts mean hotkeys. I use it all the time. Access Scripting - Scripts... menu and notice the Hotkey and chord columns. Just click in the hotkey column beside the script you want to assign a hotkey. Then press the key combination you want.