<(?![^<>]>) finds orphaned opening angle brackets (<). (?<!<[^<>])> fails to find orphaned closing angle brackets (>). Instead, it results in a syntax error.
Both regular expressions were generated by GPT-4.
Does EmEditor require an enhancement to support the second regular expression?
Samples to test the regular expressions on are as follows:
Enter the 1>Service Tag</1> or <2>Model Number</2> and click <3>Search</3>.
Or, click <1>Browse all products</1 to manually select the <2>Model</2> from the catalog.
Using Finder, browse to the <1>Downloads</1> folder.
Go to the extracted folder, install DDPM by running the <1>DDPM_Installer.pkg</1>.
Click the <1Download</1> button next to Dell Display and Peripheral Manager.
This makes it easy to switch between inputs while you work with multiple computers (1>Figure 4/1>).
To access this, click the <1>Dell Display and Peripheral Managers</1> icon on the status bar.
beneath the first character, <, of the line
and <!-- to the beginning of the
And
--> to the end of
A regular expression pattern that can find orphaned closing brackets is:
(?<!<[^<>]*)>. However, EmEditor does not support this syntax. (*inside negative lookbehind is not supported.)Regular expression is not recommended for validating HTML/XML documents. The pattern I gave above will have false negatives for many edge cases.
As an alternative solution, I recommend using either HTML or XML configuration in EmEditor, with the syntax checker feature turned on.
You can switch configurations with Tools > Select Configuration. Note that EmEditor will use the file extension to automatically select the correct configuration when opened. Then go to View > Syntax Checker to turn it on.
In this screenshot, the Syntax Checker bar shows where there is an unclosed tag. If you look around the error location, you will quickly find the orphaned brackets.
Disclaimer, this doesn't exactly answer your question fully as it doesn't show where the orphaned brackets are, but this method will hint as to where the orphaned brackets could be be.