regex - jquery - replace matched character -


i want replace comma followed < br > used regex et replace method that:

var str = "<a class=added> ,,, ,, blbl;test, </a><br>, <a class=added>" str = str.replace(/br>(,\s)/g, " ");  alert(str); 

in result noticed 'br>' removed , not exected result. there wrong regex?

"<a class=added> ,,, ,, blbl;test, </a>< <a class=added>" 

you doing regex match correctly not replacing correctly. should replace string:

"br> "

as follows:

>>> str = str.replace(/br>(,\s)/g, "br> "); "<a class=added> ,,, ,, blbl;test, </a><br> <a class=added>" 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -