English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript RegExp RegExp Object
sourceThe property returns a string that contains the source text of the regexp object, without the two forward slashes at both ends and any modifiers.
regex.source
var str = "Hello world"; var regex = /Hello/g; regex.source;Test See‹/›
All browsers fully support the source property:
Properties | |||||
source | Yes | Yes | Yes | Yes | Yes |
Writable: | No |
---|---|
Enumerable: | No |
Configurable: | Yes |
Return Value: | Text of RegExp Pattern |
JavaScript Version: | ECMAScript 1 |