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

168
Visualizações
Regex match the last group with @ character on the first character match

How can i match this string permission grant inspire @you @me @john like this match

Group 1: grant or deny

Group 2: anything character

Group 3: should match start with @ every character in match like @you @me you and this is splitted by splace

This is my try in regex ^permission\s(grant|deny)\s(.*)\s(.*)

this is my fiddle

Note: I'm using javascript, does this need lookbehinds or something else that can look around

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Converting my comment to answer so that solution is easy to find for future visitors.

You may consider this regex:

^permission\s(grant|deny)\s([^@]+)\s(.*)

Last group has this pattern ([^@]+) that matches 1+ of any character that is not a @ so that our match stops at the first @ later.

Updated RegEx Demo

about 4 years ago · Juan Pablo Isaza 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