Regular Expression Help
Hi,
I am struggling to get this regular expression to work properly and would appreciate if someone could give some help. This what I have tried but to no avail:
/>[\s]\w*\s*/ , ""
I need to clear all the spaces (but only the blank spaces and not content) that are between > </ including the carriage return line feed, if any, between all the tags from the string:
<A t="1"> ad </A> <B t="2"> ba </B>
<C t="3"> rr </C>
It should become this:
<A t="1">ad</A><B t="2">ba</B><C t="3">rr</C>
Also, can someone kindly explain to me what these reg Exp are doing?
s=s.replace(/(<)(input|img|br|hr)([^>]*)/ig,"$1$2 $3 /")
s=s.replace(/=([^"]{1}[^ ">]*)/ig,"=\"$1\"")
s=s.replace(/ (selected|checked|multiple)/ig,function(s,m){x=m.toLowerCase();return " "+x+"=\""+x+"\""})
s=s.replace(/<(\/?[A-Z]+)/ig,function(s){return ""+s.toLowerCase()})
Thanks a lot
Pall
|