---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Convert SNC regex to enhanced regex

# Convert SNC Regex expressions to enhanced regex expressions {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

When you upgrade to Eureka Patch 5 or later releases, you should convert scripts that
use the SNC.Regex API to use regular JavaScript expressions.

## Prozedur

1. From the original expression, such as: `SNC.Regex("/expr/is");`, create a new regular expression object using the pattern with the slashes stripped.  

       new RegExp('expr');

2. Move the SNC.Regex flags to the start of the expression using Java's inline flag special construct.  

       new RegExp('(?is)expr');

3. Add the <var class="keyword varname">j</var> flag to the `RegExp` to tell the engine to treat the expression as a Java expression.  
   Hinweis:  
   If you know that the script being converted does not use Java syntax, it is not necessary to use the <var class="keyword varname">j</var> flag.  

       new RegExp('(?is)expr', 'j');

4. Add the <var class="keyword varname">g</var> flag to handle multiple matches or a global replace.  

       new RegExp('(?is)expr', 'jg');

## Beispiel

Using SNC.Regex:

    var r = new SNC.Regex('/world/');
    var str = 'helloworld';
    var replaced = r.replaceAll(str, 'there');
    // replaced == 'hellothere'

Using a JavaScript regular expression:

    var r = new RegExp('world', 'jg');
    var str = 'helloworld';
    var replaced = str.replace(r, 'there');
    // replaced == 'hellothere'


