# Replace \\ with \\\\ in string

**URL:** <https://forum.kirupa.com/t/replace-with-in-string/287504>\
**Category:** flash\
**Created:** [May 2, 2009, 12:33pm UTC](https://forum.kirupa.com/t/replace-with-in-string/287504 "2009-05-02T12:33:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spectator](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@spectator](https://forum.kirupa.com/u/spectator)\
**Post date:** [May 2, 2009, 12:33pm UTC](https://forum.kirupa.com/t/replace-with-in-string/287504/1 "2009-05-02T12:33:35Z")

</div>

Hi all :). I am trying to replace \ with \, but I am having problems with the ". I know that I should do this with string.replace. but i don’t know what the regex for \ is.

```auto
 var myPattern:RegExp = /"\"/g;  
 var str:String = "She sells\ seashells by\ the seashore.";
 trace(str.replace(myPattern, "\\"));  

```

Please help. 10x in advance 🙂
