AnsweredAssumed Answered

How to escape special character in custom scripting Java script

Question asked by MadhuKamble5241 on Sep 6, 2016
Latest reply on Sep 6, 2016 by MadhuKamble5241

Hi, 

 

I am using custom javascript scripting in the map function and trying to match the following pattern

 

var patt = new RegExp("[H][X]\\d{4}*");

result= patt.test(lenovoDescription);

 

I get the below error:

 

Error executing custom script: SyntaxError: Dangling meta character '*' near index 11
[H][X]\d{4}*
^ in <eval> at line number 1

 

Please advise. 

 

Thanks,

Madhumita

Outcomes