Skip to main content
Known Participant
April 8, 2010
Question

Looking for way to replace " with \" inside of coldFusion created array for JSFL

  • April 8, 2010
  • 1 reply
  • 580 views

I am trying to figure out the best way to fix data coming from a database table through the use of ColdFusion, in which there are some quotation marks that JavaScript Flash doesn't want in the array before adding the text content to a quiz.

At the moment, if there are any quotation marks in the elements of the array, even though each element is surrounded by quotation marks, I have to add a backslash to escape them.

I was wondering what would be the regular expression to use to do this, not for the quotation marks surrounding each element, but for those used inside of them.

For example,

["08 Working with Flash Forms_16",
"The syntax for the submit button was .",
"name="submit" type="submit"",
"name="submit"action="submit"",
"id="submit" type="submit"",
"id="submit"action="submit"",
"No, name="submit" type="submit" is correct.",
"true",
"false",
"false",
"false",
"897"] ,
is an example of an element created that has quotation marks inside of the quotation marks for each element.

I am debating about handling this either with XML by writing code to do that with ColdFusion instead of using the code I generated with ColdFusion to create this.

I am also debating about writing the regular expression in a way that I could use it from either ActionScript 2 or 3.0, going at it at the file level maybe.

At the moment I am opening the file and experimenting with writing a Find expression that uses regular expression to select what I want to change before changing it.

This topic has been closed for replies.

1 reply

Known Participant
April 11, 2010

I figured this out already. You can use the either the ColdFusion function, Replace, or REReplace if you want to use regular expressions. But I just wrote an actionscript prototype function inside the superclass called replace to fix it using split and join array methods.