I\'m trying to write a Javascript HTML/php parser which would extract all opening tags from a HTML/php source and return the type of tag and attributes with their values whi
Just make sure the last letter before the '>' is not a ?, using [^?]. No lookaheads or -behinds needed.
<[a-zA-Z](.*?[^?])?>
the parentheses and the last ? is to also match tags like .
EDIT The solution didn't work for single character tags without attributes. So here is one that does:
<[a-zA-Z]+(>|.*?[^?]>)