Pay to help write a js rule

means that users can post links and pictures, but cannot send html and css styles!

the current way of writing is:

var result=str.replace(/(<\/?)([a-z]+)(\s[\w\W]*?)?(>)/ig,function(s0,s1,s2,s3,s4) {
   if (!/^(img|a)$/.test(s2))
  return "";
  if(s3)
  s3 = s3.replace(/\s+(id|class|style)(=(([\"\"]).*?\4|\S*))?/g,"");
  return s1+s2+(s3||"")+s4;
});

this is OK, but if the user publishes or > these will be replaced with html entities;

ask God to write a paragraph that can post links and pictures, but cannot send html and css styles, but can publish > characters like


  

/ < (?: (?: div | select | label | volist | option) | / | html | meta | script | form | ul | li | a | br | t) [^ >] + > / g

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46c57-43909.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46c57-43909.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?