How does one go about using grouping in Regular Expression to find html elements? The issue is when searhing a file, the < and > from javascript are found, so I want to always start with a < and end with either a > or />, or start with , then I want to look for stuff inside of that. The key thing I am looking for is capital letters in element names or attribute names.
The reason I am asking is because I have been tasked with going through all the JSP pages and changing the uppercase elements and tag names to lower case. I am simply trying to find a regular expression that is more accurate than what I am currently using. The main issue seems to be that this regular expression does not know the difference between a < or > in Javascript and in HTML.
<[^!>%]*(([A-Z]{1,})|([^A-Za-z"'>=&\?][A-Z]{1,}[a-z]*))[\s=>]