Copy link to clipboard
Copied
I have a document with a lot of "Motion X" in it, and am trying to do a big find and replace.
I dont have a good handle on grep and have done the expression "Motion\s\d*" which does work, but it is also including text such as "Motion carried / lost". Example below.
I just want to restrict it to finding the word "Motion", then a space and then a number after it (could be 1 to 3 digits).
I did play around with using square brackets but that didn't seem to help. Any help would be greatly appreciated, thanks.
Hi @danielw42205661 ,
the * od d means zero or more digits.
You could try also this:
Motion\s\d{1,}
Which means one or more digits in a row. You could restrict the maximum number of digits in a row if you add a second number after the comma. Or you could change the first number to 2 if you want to find only a minimum of two digits in a row.
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Are you trying to replace the word Motion?
Motion\s\d+?
If you want to replace just the word Motion
Motion(\s\d+?)
Change to
New Word$1
Does it ever have Motion 1.01 (with decimals)?
Copy link to clipboard
Copied
Hi @danielw42205661 ,
the * od d means zero or more digits.
You could try also this:
Motion\s\d{1,}
Which means one or more digits in a row. You could restrict the maximum number of digits in a row if you add a second number after the comma. Or you could change the first number to 2 if you want to find only a minimum of two digits in a row.
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
\d{1,}
By @Laubender
That is such an awesome GREP!
Copy link to clipboard
Copied
Thanks! Worked a treat.