just need a quick help for solving this problem.
I want to strip all html tags out of a string except the tags from a whitelist(variable).
My code so far:
whitelist = 'p|br|ul|li|strike|em|strong|a',
reqExp = new RegExp('<\/?[^>|' + whitelist + ']+\/?>');
The problem is now it works more or less fine but also not removing for example b because it matches the b from the br out of the whitelist.
I tried different approaches but dont find the right solution.
How can i tell the regex to do something like /.WITHOUT(smth)/ (therefore: match all expect everything following).
Use this regex:-
LIVE DEMO
For more information, refer to my earlier answer, which fullfill your requirement.