← Home
🔥0 DAY
0 XP
Tools · Developer Utility

SERVICENOW
REGEX TESTER.

Build and test regular expressions for ServiceNow client scripts, business rules, inbound email actions, and ACL conditions. Pick a preset, tweak the pattern, and copy a ready-to-paste snippet.

Presets

Linked record 6816f79cc0a8016401c5a33be04be441 and parent a9e30c7d4ff1120031577d2ca310c7f3 — see logs.
2 matches

Match details

#PosValueGroups
0146816f79cc0a8016401c5a33be04be441
158a9e30c7d4ff1120031577d2ca310c7f3

Copy into ServiceNow

// Business Rule (before / after)
(function executeRule(current, previous) {
  var re = /\b[a-f0-9]{32}\b/gi;
  var text = current.short_description.toString();
  var hits = text.match(re) || [];
  gs.info('regex hits: ' + hits.length + ' → ' + hits.join(', '));
})(current, previous);

Regex gotchas in ServiceNow

  • Server scripts run on a Rhino-derived engine. Lookbehind (?<=) is unreliable on older instances — prefer capture groups.
  • In XML condition strings (sys_dictionary defaults, UI Policy expressions), escape backslashes twice — \\d in JS becomes \\\\d in XML.
  • GlideElement.toString() before .match() on server side or you may get undefined on empty fields.
  • In inbound email actions, combine email.subject + email.body_text before matching so values in either place are caught.

About this tool

Free · Browser-based · No signup

The SparkCoder ServiceNow Regex Tester is a free, browser-based utility for building and testing regular expressions used in ServiceNow client scripts, business rules, inbound email actions, and ACL conditions. It includes presets for sys_id, incident numbers, emails, URLs, and more.

Pick a preset, edit the pattern and flags, and copy a ready-to-paste snippet. All matching happens locally — your test strings never leave the browser.

Built by SparkCoder, an arcade-style practice app for ServiceNow scripting interviews.