Copy link to clipboard
Copied
how do you search and remove numbers like dd.dd where the second digit string can be one or two in size? For example
18.55
or
18.5
Grep:
(\b\d{2})\.\d{1,2}\b
Change to:
$1
- Mark
Edit: didn't read the question right at first!
Copy link to clipboard
Copied
Grep:
(\b\d{2})\.\d{1,2}\b
Change to:
$1
- Mark
Edit: didn't read the question right at first!
Copy link to clipboard
Copied
You want to go from 18.55
or 18.5
to 18
???
\d+\K\.\d{1,2}
Copy link to clipboard
Copied
@Eugene Tyson, that will also match part of longer digit strings, eg. in "1234.1234" it will match ".12". ( I did the same as you at first and at least you read the question correctly!) - Mark
Copy link to clipboard
Copied
Oh silly me I didn't try with longer string. Only with sample provided and it worked for me.
But perhaps it was too open ended.
Nice work on the GREP - I would have gotten there.
I don't use much but know a little to help out from time to time - usually there is a much neater way to do things than the way I approach them.
Thanks
Copy link to clipboard
Copied
Yeah Eugene, I'm the same. I give it a go, and then wait for the big kids to show me a *waaay* smarter approach. It's fun. 🙂
Copy link to clipboard
Copied
No. I got your first response and it is exacty what I needed, THANKS!
Copy link to clipboard
Copied
Don't apologize, GREP is all but an easy subject (it actually becomes easier with a lot of practice). What matters is to keep learning 😉
Also don't hesitate in taking advantage of the GREP F/C dialog within InDesign and the shortcuts the dialog offers (see @ button):
Then you can copy-paste supplied code as a starter.
FWIW
Loic