Does anyone know how can I format the text between "<" and "> using GREP?
CIDADE DE SÃO PAULO. Sistema Integrado de Gestão do Relacionamento com o Cidadão - Manual do Usuário - Módulo Atendimento. São Paulo: Prefeitura de São Paulo, 2020b. Disponível em: <http://wiki.govit.prefeitura.sp.gov.br/images/8/8f/Apostila_M%C3%B3dulo_Atendimento._revFinal_2020.p...>. Acesso em: 16 de jan. de 2023.
In my example above, I want to finde the red text (between "<>") and format it.
change to is blank but you would apply formatting of a character style for the red)
Mike's expression would format more text than intended if there is more than one set of <> in the paragraph.
I would use either (?<=\<).+?(?=\>) or (?<=\<)[^>]+(?=\>), presuming there ar no cases of nested text.
Also thanks for your time. I'm still getting all text replaced. Please, check it out:
I must be doing something wrong, right?
Hi Mike, thanks for your time.
I've tried it but I got all text replaced by the new style.
This is a sample of the text I have:
And this is what I got:
What I am doing wrong?
Need to see the entire Find/Change dialog box to see the formatting applied, but my suspicion is you are changing to a PARAGRAPH style rather than a CHARACTER style.
There you go...I'm replacing the character style.
What text is selected when you click Find? Does it select more than what's inside the < >?
Can you share a one-page sample file?
OK, I see the problem. There is an error in Mike's original GREP expression, and I carried it through in my suggested changes.
Remove the \ before the < and > in the look-behind and the look-ahead and it should work.
Yep! it worked! Many thanks!
Ah yes, you are correct. I will edit my above answer.