Ok, some things are off:
You are using a script expression, so you don't need the job arrived entry point. You can just write your code, store the output in a variable and in the last line type the variable name with a semicolon.
Job.getvariableasstring() expects a switch variable as string, so that's not going to work
It's better to just end with
re[1];
Regular expressions in Switch can behave differently then regular expressions in node.js, it is useful to check the enfocus documentation on what they support. For example, something only the g and i flags are supported, m is not
https://www.enfocus.com/manuals/Develop ... egexp.html
.
There is not a true debugger with breakpoints, but you can use job.log() and s.log() like you would use console.log() in other environments. Difference is that logs don't go to console, but to switch messages. There are different types of logs, which makes the syntax differently
job.log(-1, "this is a debug message") ;
job.log(1, "this is a normal message") ;
job.log(3, "this is an error message") ;