# RegExp help

**URL:** <https://forum.kirupa.com/t/regexp-help/299597>\
**Category:** flash\
**Created:** [November 7, 2009, 3:11pm UTC](https://forum.kirupa.com/t/regexp-help/299597 "2009-11-07T15:11:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greetification](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@greetification](https://forum.kirupa.com/u/greetification)\
**Post date:** [November 7, 2009, 3:11pm UTC](https://forum.kirupa.com/t/regexp-help/299597/1 "2009-11-07T15:11:03Z")

</div>

Hi i’m trying to do a string replace with but can’t seem to get the regular expression right. Can anyone help me change “/portfolio/2/3/” to “portfolio\_2\_3”?

Basically I want to remove the leading and following slashes, and convert all the other slashes to underscores.

Thanks!
