I would like to create a pattern that matches HTML markups with properties where the values of all properties should start with a letter followed by alpha numeric characters. Some properties should have names that contain a hyphen and the Class property should be able to contain multiple values separated by an empty space.
The following is the REGEX pattern I have created and it matches any string containing HTML markups which has zero or more properties with names and values that can consist of only alpha numeric characters and hyphens. However, I’m struggling to come up with a pattern that matches what I’ve described above.
<([a-z-]+)\s?[a-z-="\s?]*\/?>(\n?.*\n?<\/\1>)?