# JavaScript Regular Expressions inASP

**URL:** <https://forum.kirupa.com/t/javascript-regular-expressions-inasp/160527>\
**Category:** programming\
**Created:** [August 26, 2005, 5:11pm UTC](https://forum.kirupa.com/t/javascript-regular-expressions-inasp/160527 "2005-08-26T17:11:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bandinopla](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bandinopla](https://forum.kirupa.com/u/bandinopla)\
**Post date:** [August 26, 2005, 5:11pm UTC](https://forum.kirupa.com/t/javascript-regular-expressions-inasp/160527/1 "2005-08-26T17:11:21Z")

</div>

Hi, I’m using javascript in asp insted of using vbscript… bicouse I like more and is like actionscript, etc. My problem is:

in PHP i can use regular expression like: /(\W)/ to replace all the nonCharacters in a string… but in Javascript, when I do the same thing… jscript only replace the first nonCharacter and the rest is not concider… for example, when I put in bold “asdas %dfsdf%sffsd&”.replace(/(\W)/, “\<b\>$1\</b\>”) only the first % is in bold… with php, all the character are put in bold… Whats the problem? if is a problem…
