JavaScript RegExp source attribute
- Página anterior multiline
- Próxima página compile()
- Voltar para a camada superior Manual de Referência 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 direct quantity of the regular expression, 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
É uma característica do ECMAScript1 (ES1).
Todos os navegadores suportam completamente ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Suporte | Suporte | Suporte | Suporte | Suporte | Suporte |
- Página anterior multiline
- Próxima página compile()
- Voltar para a camada superior Manual de Referência JavaScript RegExp