Javascript examples for RegExp:Bracket
Replace numbers between [] like [123]
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w. j a v a 2 s. c om*/ function replaceStr(string,orgText,replaceText){ var res = string.replace(orgText, replaceText); return res; } console.log(replaceStr("[12345].Checked",'12345','1')); } </script> </head> <body> </body> </html>