i was trying to get an expression for google script for a google document that i cant get. I want to find all occurences of words that are: “X-X-Xr”
Where “X” is a capital letter or number, “-” it is literally -, and “r” is literally r. I want to find all occurences and then highlight them. The word could be between two blank spaces, or right after a “:”
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
Try this:
I created a file named X-X-Xr and ran the code.
You could post files into a sheet with a setValues if you wish.
Using Regxr and Body.findText() you should be able to find the strings you want.
Here is a sample code for Google Doc for the same text shown above.