Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

95
Visualizações
Understanding ECMAScript production parameterized annotations

I have been reading about how regular expressions are parsed in JS in this link: https://262.ecma-international.org/13.0/#sec-regular-expressions, but I don't quite understand what are the parameterized annotations [N] and [Sep].

Like in this example:

enter image description here

If I am not wrong I think that the annotation [UnicodeMode] refers to the Unicode flag of the regexp.

Can someone guide me into what [N] and [Sep] means?

almost 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

For how parameterised grammar productions work in general, see JavaScript grammar notation.

If I am not wrong I think that the annotation [UnicodeMode] refers to the Unicode flag of the regexp.

Yes indeed, it is used in ParsePattern which is called both for regex literals and from the RegExp constructor, and the UnicodeMode grammar flag is set when the /u regex flag is given.

Can someone guide me into what [N] means?

This flag is used to change the meaning of named backreferences. If the regex contains at least one named group (?<name>…), then \k<name> notation will refer to such groups (and a group with the given name must exist, according to early error static semantics). But if the regex does not use (?<…>…) anywhere, then \k will just be treated as an IdentityEscape (i.e. matching a literal k in the input text).

What about [Sep]?

That's just a reference to the DecimalDigits production from the normal number literal grammar. It prevents the use of a NumericLiteralSeparator in the number, essentially making it a production matching only integer literals.

almost 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda