$subject = '<input type = "text" class="a-sdsd" name="name">asdasdsdsa</input>'; $pattern = '^<[a-z]+\s+([a-z-]+\s*=\s?"[^"]+"\s*)*>(.+</[a-z]+>)?';