Try this:

var strText = "'ben is 'aight with me'";
        
alert(
  strText.replace( 
    new RegExp( "(.{1})'(.{1})", "g" ), 
    "$1$2" 
    )
  );


This makes sure that the single quote has one character before AND after
it and then replaces the match with the before and after group (leaving
out the single quote). 

......................
Ben Nadel
Certified Advanced ColdFusion Developer
www.bennadel.com
 

-----Original Message-----
From: loathe [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 12, 2006 12:29 PM
To: CF-Talk
Subject: JS and RegEx Q?

I have fieldValue = fieldValue.replace(/'/g,"/'");

The thing is I need to NOT replace the first or last single quote in
that string, only the ones in the middle, anyone know how to do that?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256537
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to