-
1. Re: White spaces & inline graphics
P Spier Jun 27, 2010 4:04 AM (in response to Maria964)I see none of the GREP wizards has come up with anything, so I've given it a shot.
I first tried looking for an anchored object marker surrounded by spaces, written as \s(~a)\s which seemed to work as far as locating the inlines, but when I tried replacing that with ~<$1~< (thin space(found text1)thinspace) the inline itself disappeared, so it seems you don't want to find the inline as part of the search result, but instead split the search into two parts and find a space followed by an inline marker and a space preceded by one. In other words use look ahead and look behind. Look ahead and look behind don't return the anchored object itself, keeping it safe from change.
The first expression would be \s(?=~a) and the second is (?<=~a)\s
The change to is just ~< in both cases.
You can replace the \s, which finds any white space, with a specific space or typed space if you like. The two searches can be chained together to run as one operation in a script. Peter Kahrel has one at http://www.kahrel.plus.com/indesign/chain_queries.html
-
2. Re: White spaces & inline graphics
Maria964 Jun 27, 2010 7:25 AM (in response to P Spier)Hi, Peter
This works great and is wonderful because I can include it in a grep style.
My knowledge of grep is very poor but I know enough to use a OR in your expression so, if I use "\s(?=~a)|(?<=)\s", the grep search does the job inside the paragraphs and I don' have to do two searches.
But a problem remains -- You can see it in this image:
Can you help me?
Thank you in advance,
Maria
-
3. Re: White spaces & inline graphics
[Jongware] Jun 27, 2010 7:37 AM (in response to Maria964)The "\s" wildcard picks up any whitespace character, including hard and soft returns.
If you are sure you only used regular spaces, you can safely replace the "\s" in your expression with a space. If you may have used other kinds of space, such as the fixed width ones, you'll have to add them with an inclusion group: [ ~S~s]
-
4. Re: White spaces & inline graphics
Maria964 Jun 27, 2010 8:09 AM (in response to [Jongware])Thank you Peter and thank you Jongware.
Next week I am going to be much more productive. So I will have more spare time and I will use it to study Grep.
That is a promise!




