Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

regular expression does not execute runtime

Avatar

Level 2

Hello adobe collegue's,

I am currently stumbling on a strange issue regarding javascript embedded to compress a string:

// main function to compress any string, removing all non-word characters and making the string all lowercase

function compressString(input){

    var patt=new RegExp("\\W","g");

    patt.compile(patt);

    var output = input.toLowerCase().replace(patt,"")+"YESS";

    return output;

}

Somehow this code does execute perfectly while previewing in adobe designer 9.0.0.2 but runtime all javascript does execute except for the part mentioned above.

I know this part is executed because in the result i see the string "YESS" added to the response of this function.

Somehow the pattern is not compiled, or executed runtime...

I also tried more simple regular expressions but none of them actually worked.

For the templates the option client is set where to execute the javascript, although while testing the options to solve the issue is also tried settings both and server. None provided the solution.

Can someone provide any help...it's appreciated!

Thanks,

Marcel

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

you can make your function more simple.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

you can make your function more simple.

Avatar

Level 2

somehow the string option for defining a regular expression works as suggested by radzmar! Thanks!

Strang though that previewing in adobe designer worked while processing the template runtime in adobe livecycle output module did not.