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

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

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