Siebel eScript Language Reference > Methods Reference > Regular Expression Methods >

Compile Regular Expressions Method


The Compile Regular Expressions method modifies the pattern and attributes for the current instance of a regular expression object. It allows you to use a regular expression instance multiple times with modifications to the characteristics of this instance. You use it with a regular expression that the constructor function creates. You do not use this method with the literal notation.

Format

regexp.compile(pattern[, attributes])

Table 115 describes the arguments for the Compile Regular Expressions method.

Table 115. Arguments of the Compile Regular Expressions Method
Argument
Description

pattern

A string that contains a new regular expression.

attributes

A string that contains new attributes. If you include the attributes argument, then this string must be empty, or it must contain one or more of the following characters:

  • i. Sets the ignoreCase property to true.
  • g. Sets the global property to true.
  • m. Sets the multiline property to true.
Example

The following example uses the Compile Regular Expressions method:

var regobj = new RegExp("now");
// use this RegExp object
regobj.compile("r*t");
// use it some more
regobj.compile("t.+o", "ig");
// use it some more

Related Topics

For more information, see the following topics:

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.