Hello, struggling to get my head round an expression that will do this... need to add a bold style to a couple of variations on a few words always after a 'the' for example:
take a look at the dolphin ecolocation visual
watch the dolphin hunting video
look at the dolphin ecolocation handout
I've bolded what I want to bold within the text. I've tried a few variations on positive look aheads and using an or expression to cover the various endings of the phrase i'm looking for... rough outline of where I got to below
Try this one. You were missing a space after the initial "the" and \w don't match space between words so it's better to replace it with a dot "any character". If you have use the (?i) because this could be in upper and lower case you can put it at the begining of the query.
This is bolding the 'the' as well which I don't want...
Copy/Paste error... misisng <
Hi Jean-Claude, is there a way to take into account for soft returns? I tried using \s but i'm not sure it's classed as a white space character.
\n is a soft return character.
Add (?s) at the begining.
I'm concerned that you're not providing enough context as to how your sample text will appear in the bigger picture. That being said, I've included a screen shot below of the GREP expressions that I wrote to make this happen. I'm basically just using a positive lookbehind for "take a look at the", "watch the", and "look at the", and then applying bold to everything that follows it.
the sample text was just an example, the text before what I want will be hard to predict but I know that follwing a 'the' and up to visual/handout/ etc is consistent
In that case, Jean-Claude's expression should work. Did you try it?
Well, if it's performance you're after you should use non-matching subexpressions and \K instead of the classic lookbehind: