Copy link to clipboard
Copied
Hi, i am trying to apply my BOLD character style to "Figure 1" in my copy. and i set the code to the below. as in apply bold to any word Figure and whatever number(s) is next to it. but this is not correct, what am i doing wrong?
(Table|Box|Figure)\s\d+
You need to put your three variations within parentheses, otherwise it will find just the word Table, just the word Box, or the word Figure followed by a space and one or more digits.
Copy link to clipboard
Copied
If you always have a space after the word Figure, then all you need is Figure \d+
But keep in mind that if you want your parentheses to also be bold, you will need \(Figure \d+\)
Copy link to clipboard
Copied
No, your regex is incorrect. What you have written is: apply bold to the word Figure if it is followed by a digit (or more). Try this:
Figure\s\d+
It means the word Figure, followed by one space and one or more digits
Copy link to clipboard
Copied
jmlevy wrote
No, your regex is incorrect. What you have written is: apply bold to the word Figure if it is followed by a digit (or more).
Actually it's just "Figure" when followed by one of more plain d's (also without any space). So it'd match "Figured" and "Figureddd" but not "Figure 2" or "Figure2".
Copy link to clipboard
Copied
that did it. so if i want to say to that however to also look for the word "Table" and "box" the code will be:
Table|Box|Figure\s\d+
correct? because "|" means "or"
Copy link to clipboard
Copied
just tried that last code and "Box" goes bold, but not the number next to it:
Copy link to clipboard
Copied
(Table|Box|Figure)\s\d+
You need to put your three variations within parentheses, otherwise it will find just the word Table, just the word Box, or the word Figure followed by a space and one or more digits.
Copy link to clipboard
Copied
BINGO!
Copy link to clipboard
Copied
how would you tackle adjusting that code if there is a letter instead of a number and if there was two letters, like the two below circumstances? i have "Figure 2A" and "Figure 2B-C"
Copy link to clipboard
Copied
You can add the following to the existing code - it will catch these instances along with the plain number ones
\u?–?\u?
Your full code will look like this:
(Table|Box|Figure)\s\d+\u?–?\u?
Just make sure that the dash or hyphen you use in the code is the same one that you used in your text. (In this usage, should be an n-dash)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now