wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes how can we get backslash-dot in string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how can we get backslash-dot in string" Watch "how can we get backslash-dot in string" New topic
Author

how can we get backslash-dot in string

Gaurav Singh
Greenhorn

Joined: Jan 03, 2004
Posts: 7
Hey guys,

I am trying to do an apparantly simple replace in javascript, but can't seem to find a way to do it.

I just need to replace the dot in string "*.*" to get result "*\.*"
Following is the statement I am tryin to use

"*.*".replace(/\./gi,'\\\.');

Tried other versions as well
"*.*".replace(/\./gi,'\\\.');
"*.*".replace(/\./gi,'\.');

etc etc. None of which get me the desired result.

Can anybody please tell me a way to do this.

Thanks
Gaurav
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can we get backslash-dot in string
 
Similar Threads
Need Xalan Help
Xalan Question and some advice
html escaper
how do i restrict HTML tags in textarea
new option() and &