Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

SNC Regex API Throwing Exception in Scoped Application

thisisauniqueus
Giga Expert

Hi,

I am trying to use SNC Regex in a scoped application and its throwing an exception. Is there anything for scoped application in Servicenow?

Any help in this regard is appreciated.

Regards,

JS

2 REPLIES 2

venkatiyer1
Giga Guru

Hi John,



Try using SNRegExp It works in scoped application.. simple example would be





      var pattern = new SNRegExp('-X-');


      var results = ('_-X-__-XX-___-XXX-').match(pattern);


      if(results !== null) {


              gs.info("match: " + results);


              //results = pattern.match();


      }


SNRegExp is allowed but giving null for my string. For a requirement I need to use SNC.regex