Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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