*cries* I just typed a nearly complete article and closed the tab. I need to write my drafts on my filesystem from now on...
Anyway, what do you mean by "taken into variables"? Please be as precise as possible.
Here's a pattern for a simple tag. Refer to the W3Schools reference for details and see how far you can go with the attribute pattern.
Code:
var regex = /^<([a-z][a-z\d]*)\s*\/?>$/mi;
Every HTML tag begins with a letter, but some (AFAIK only h1-h6) have numbers after that. I also optionally included the XHTML self-closing-tag slash and the zero or more whitespace characters which some browsers require with it.
Bookmarks