source

Summary

Returns the regular expression pattern.

Usage

public property string source()

Returns

The regular expression pattern without delimiters and flags.

Description

Returns the regular expression pattern without the forward slash delimiters and flags. Thus, /abc+/i will return abc+.

Although the JS++ grammar is an augmentation of the ES3 JavaScript grammar, source conforms to ES5 and will return (?:) if the regular expression pattern is empty. Furthermore, as in ES5, line terminators are escaped.

Examples

Basic Usage
1
2
3
4
import System;
 
System.RegExp re = new System.RegExp(/abc+/i);
Console.log(re.source); // "abc+"

Share

HTML | BBCode | Direct Link