Logo Passei Direto
Buscar

sfg

Creating a regular expressionEDIT


You construct a regular expression in one of two ways:


Using a regular expression literal, which consists of a pattern enclosed between slashes, as follows:


var re = /ab+c/;

Regular expression literals provide compilation of the regular expression when the script is loaded. When the regular expression will remain constant, use this for better performance.


Or calling the constructor function of the RegExp object, as follows:


var re = new RegExp("ab+c");
User badge image

Enviado por Paul Snow há 8 anos

Respostas

User badge image

dev-test-question-api@mail.com

há 7 meses

Essa resposta te ajudou?

0
Dislike0
left-side-bubbles-backgroundright-side-bubbles-background

Crie sua conta grátis para liberar essa resposta. 🤩

Já tem uma conta?

Ao continuar, você aceita os Termos de Uso e Política de Privacidade

Ainda com dúvidas?

Envie uma pergunta e tenha sua dúvida de estudo respondida!