I'm trying to match any open HTML tag except input tag using regular expression in PHP. Here is my pattern.
/<([a-z]+)([^>]*>)?/i
It matches all below:
<input type="text">
<img src=">
<a href="">
<button type="button"></button>
<div id="some"></div>
<p></p>
I don't want to match input. I may exclude more tags in the future as I stated some tags in my question title.
What I've tried so far
[Edit]
As per my example, I also want to keep the tag name only returned in the matched results, e.g, img, a, button, div, p, etc.