Hi Paulette--
Arbortext has quite good Javascript support, and you'll find that Javascript regex handling is much more complete than what ACL supports.
The easiest way to do what you are describing is to:
1) define a Javascript function to do the text operation you want. You will pass the input information as parameters, and return the result as a string. For example, something like this:
function noSpaces(text) {
return text.replace(/ /g, '');
}
2) make sure the javascript file that contains the function definition gets loaded on startup, either by putting it in $APTCUSTOM/init (with a .js extension), or by explicitly loading it using the js_source() function in one of your ACL startup files.
3) when you want to apply the function, use the javascript() ACL function. It takes a string of Javascript code and executes it, returning any value to ACL that the Javascript code returns. You'll need to compose the Javascript function call with the parameter values inserted as strings. Using the pervious example, if you wanted to get the title of a document without the spaces, you could do something like this in ACL:
# assume $title var contains the title text
local fname = javascript("noSpaces(" . $title . ")");
Once you get your brain around that model, it's pretty easy to get info back and forth between Javascript and ACL.
--Clay
Sent from my iPad