Copy link to clipboard
Copied
I am currently using this GREP to select when there are certain words+Numbers or other characters in brackets.
(\(|\[)(Bild|Fig|Pos|Item|Pic|Photo|Abb)\s*\.*\d*\+*\d*\.*\s*~e*(\)|\])
This expression isn't ideal because it won't work if there are numbers and plus symbols one after another multiple times (as seen in the screenshot below).
Is there a GREP expression that finds open bracket + Word and then selects everything until it finds a closed bracket?
The simplest would be to look for ([word] up to the next closing parenthesis:
[(\[]((Bild|Fig|Pos|AbbItem|Pic|Photo)\.?).+?[)\]]
But if you want to match numbers and maybe +, then use this:
[(\]]((Bild|Fig|Pos|AbbItem|Pic|Photo)\.?)[\d\+]+[)\]]
Copy link to clipboard
Copied
I'm not a GREP expert - but until someone better than me will chime in - you could take your "numbers" part in brackets and add "+" afterwards - it will tell InDesign to look for multiple occurrences:
(\s*\.*\d*\+*\d*\.*\s*~e*)+
Or it should be possible to shorten it to ".+" but as GREP in InDesign is "greedy" - "?" need to be added in the right place - but I'm not good at it and I'm replying from my phone.
Copy link to clipboard
Copied
The simplest would be to look for ([word] up to the next closing parenthesis:
[(\[]((Bild|Fig|Pos|AbbItem|Pic|Photo)\.?).+?[)\]]
But if you want to match numbers and maybe +, then use this:
[(\]]((Bild|Fig|Pos|AbbItem|Pic|Photo)\.?)[\d\+]+[)\]]
Copy link to clipboard
Copied
I think OP wants also to include occurrences in square brackets - could you please modify your examples?
Copy link to clipboard
Copied
Hadn't spotted those, thank you.
Copy link to clipboard
Copied
Thank you!
This solved my problems.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now