I can't seem to put together a working pattern to disallow all html tags except for the strong and em tag.
I don't want to parse the html but just want to give the user a warning that the input will not be accepted. I am aware that this is not supported in all browsers but I would love a pure html solution, as I already have a working JS solution, but I wan't to layer the user experience.
<input name="user_input" pattern="^(?!<[^>]*>).*$" />
So allowed tags: strong, em the use of all other tags should make the result false
Any one able to crack this one?
KR
edit:
<input type="text" pattern="((?!<(?!\/?(strong|em))[^>]*>).)*">
is what seems to do the trick. Thank you for your help!