Skip to main content
Inspiring
August 5, 2020
Answered

Search for "no space" before / after word?

  • August 5, 2020
  • 1 reply
  • 1340 views

Howdy-

I'm trying to find a way to search for a "lack" of a space-

 

For example, I have received a document in which each period has been replaced with a double hash (##).

Some also have the space after deleted, so what I have can look like this:

 

...went to the school on Thursday## Burritos were the main thing....

or

...went to the school on Thursday##Burritos were the main thing....

 

Is there a way to search for "##" without a space before or after?

Was hoping to find a symbol, but alas...

thanks!

This topic has been closed for replies.
Correct answer Jongware

You can use GREP to search for a not-a-space character with the code \S (the inverse of \s – "any whitespace"). But what do you want to do next?

 

If tepkace with full-stop plus a space: You can use a more complicated GREP (because it must preserve whatever character is there) but it may be easier to just change ## to full-stop * space, and then replace all double spaces with one.

1 reply

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
August 5, 2020

You can use GREP to search for a not-a-space character with the code \S (the inverse of \s – "any whitespace"). But what do you want to do next?

 

If tepkace with full-stop plus a space: You can use a more complicated GREP (because it must preserve whatever character is there) but it may be easier to just change ## to full-stop * space, and then replace all double spaces with one.

turner111Author
Inspiring
August 5, 2020

Thanks! I just want to replace with a space.

Would be great if you could script a more complex find/replace, like actions work in other Adobe stuff.

I guess maybe you can, but I don't know much about GREP.