Hello,
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?
Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.


var selectedText = UltraEdit.activeDocument.selection; /* get selected text */
if(selectedText.length>0) { /* anything selected ? */
/* let's search for a simple SQL date patttern */
var findResult = selectedText.match(/\d\d-\d\d-\d\d\d\d/); /* javascript use it's own Perl regexp engine */
if(findResult==null) { /* nothing found returns a null object */
UltraEdit.messageBox("Date pattern not found");
}
else {
UltraEdit.messageBox("Date pattern found: "+findResult);
}
}



