Hi Valdor, Thanks for the reply, I've just tried this code but no joy... :(
var doubleSlash : RegExp = /\\\\\\\\/g; var slash : RegExp = /\\\\/; winMessage = winMessage.replace( doubleSlash, slash ); I'm sure it's easy when you know how :) Nick On 8 November 2011 19:24, valdhor <[email protected]> wrote: > ** > > > As I understand it the backslash character is special in both the regex > and the replacement string, so it has to be double escaped in both places. > That means, for every single backslash you want to match or insert, you > have to put *four* backslashes in the regex or replacement string. > > > --- In [email protected], Nick Middleweek <nick@...> wrote: > > > > Hi, > > > > I'm trying to replace a double slash with a single slash and am having a > > little trouble, has anyone done this before? > > > > Here's what I've got thus far... > > > > var doubleSlash : RegExp = /(\\)(\\)/g; > > var slash : RegExp = /(\\)/; > > > > winMessage = winMessage.replace( doubleSlash, slash ); > > > > > > Cheers, > > Nick > > > > >

