The for loop needs to start at 1. the regex function needs to work with a JSL variable, it can't use the column. You might want to use a table variable to hold the list of words to delete rather than keeping them in a column. the JSL could be a lot simpler...see second example.
example 1
New Table( "Untitled 1", Add Rows( 10 ), New Column( "words to remove", Character, "Nominal",
Set Values(
{"aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj"}
)
),
New Column( "source", Character, "Nominal",
Set Values(
{"the aaa is bbb and bbb ccc", "a aaa b bbb c ccc ccc", "b bbb c ccc", "",
"", "", "", "", "", ""}
)
),
New Column( "redacted", Character, "Nominal",
Formula(
x = :source;
For( i = 1, i <= 10, i++,
x = Regex( x, :words to remove, "", GLOBALREPLACE ),
);
x;
)
)
);
example 2
New Table( "Untitled 2", Add Rows( 10 ),
New Table Variable( "redactionlist", "aaa|bbb|ccc|ddd|eee|fff|ggg|hhh|iii|jjj" ),
New Column( "source", Character, "Nominal",
Set Values(
{"the aaa is bbb and bbb ccc", "a aaa b bbb c ccc ccc",
"fred iii ralph bbb bbb", "a aaa b bbb", "", "", "", "", "", ""}
)
),
New Column( "redacted", Character, "Nominal",
Formula( Regex( :source, :redactionlist, "", GLOBALREPLACE ) )
)
)
Craige