Copy link to clipboard
Copied
Hi. (This may be a duplicate post, but I couldn't find my first attempt, so here we go again...)
More GREP ineptitude from me. I'm afraid. I need to be able to make just the first number within the parentheses bold, but not any others. In this sample, I have the solution:
(1) Surname Initial et al. Journal 2000;10:2XX–2XX; (2) Surname Initial et al. Journal 2000;10:2XX–2XX;
(3) Surname Initial et al. Journal 2000;10:2XX–2XX; (4) Surname Initial et al. Journal 2000;10:2XX–2XX;
(5) Surname Initial et al. Journal 2000;10:2XX–2XX; (6) Surname Initial et al. Journal 2000;10:2XX–2XX;
(7) Surname Initial et al. Journal 2000;10:2XX–2XX.
(?<=\()\d+.*?(?=\)) works well, but there are times when there is another number buried within each reference that can be in brackets, like this:
(1) Surname Initial et al. Journal 2000;10(23):2XX–2XX; (2) Surname Initial et al. Journal 2000;10(23):2XX–2XX;
What do I need to add to my GREP to only choose the first parenthethical number? I thought a second GREPwould work, but, alas, no:
(?<=; )\d+
Any suggestions? They are all separated by a semicolon/space or semicolon/soft return, (which I guess may require yet another GREP! <sigh>) if that helps These are set scientific styles and unfortunately cannot be altered to make my life easier...
This is pretty similar to yesterday's question, and again I can only make it work here using two expressions:
(?<=^\()\d+(?=\)) for the first one at the start of a your list and (?<=; \()\d+(?=\)) to find the rest. This presumes your lines are separated by hard returns. If you have lines that are ending in a semicolon followed by a soft return, using (?<=;\s\()\d+(?=\)) will get the ones after the soft retuns (and hard returns as well) along with the ones mid-line.
Your trick with the parenthese
...Copy link to clipboard
Copied
Hi, I'll merge this post with the conversation you started yesterday. If you wish to look at the posts you've done, you can click on the Profile Icon on the top right, and select View Community Profile.
Thanks,
Nikunj
Copy link to clipboard
Copied
thank you, but this is actually a related but different query. The original post was to do with endnotes. This question is about bibliography, which is completely different. Please can you take it back to a separate question? otherwise I'll not get an answer
Copy link to clipboard
Copied
Done, I've made it a dedicated post again. Sorry about the confusion!
For what you're looking for, I found this (?<=^|\;\s?)\(\d+\)
Can you check if that helps?
Thanks,
Nikunj
Copy link to clipboard
Copied
It's not catching the first number - not the first time, or after a soft return. It does, however, ignore other instances of parenthetical numbers, so yay!
I also needed to split it into 2 GREPs (at the pipe) - it wouldn't work as a single expression
Copy link to clipboard
Copied
This also made the parentheses around the starting number bold, which is not the style. Oh well. back to the drawing board 🙂
Copy link to clipboard
Copied
This is pretty similar to yesterday's question, and again I can only make it work here using two expressions:
(?<=^\()\d+(?=\)) for the first one at the start of a your list and (?<=; \()\d+(?=\)) to find the rest. This presumes your lines are separated by hard returns. If you have lines that are ending in a semicolon followed by a soft return, using (?<=;\s\()\d+(?=\)) will get the ones after the soft retuns (and hard returns as well) along with the ones mid-line.
Your trick with the parentheses around the ^ did not work for me to combine the two...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now