JavaScript RegExp source attribute
- Προηγούμενη σελίδα multiline
- Προηγούμενη σελίδα compile()
- Επιστροφή στο επίπεδο πάνω Εγχειρίδιο Σημειώσεων JavaScript RegExp
Definition and usage
source
The property returns the text of the RegExp pattern.
description
RegExp object properties source
It is a read-only string. It stores the text of the RegExp pattern. This text does not include the delimiters used by the literal regular expressions, nor does it include the flags g, i, m.
example
let text = "Visit CodeW3C.com"; let pattern = /W3S/g; let result = pattern.source;
syntax
regexp.source
return value
type | description |
---|---|
string | RegExp pattern text. |
browser support
source
是 ECMAScript1 (ES1) 特性。
Είναι χαρακτηριστικά ECMAScript1 (ES1).
Όλοι οι προγράμματα περιήγησης υποστηρίζουν πλήρως το ES1 (JavaScript 1997): | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη |
- Προηγούμενη σελίδα multiline
- Προηγούμενη σελίδα compile()
- Επιστροφή στο επίπεδο πάνω Εγχειρίδιο Σημειώσεων JavaScript RegExp