Skip to main content
EmOlivette
Known Participant
July 16, 2021
Answered

Simplest way to say search all spaces, except hair space

  • July 16, 2021
  • 1 reply
  • 340 views

I know I could list out all the space options separated by "|" but I want to be able to say \s but not ~| 

How do I say this simply in GREP? Is there a way to Escape something like this?

 

Here is my full GREP find: 

(?<!~<)( ?)(~_|~=|~-­|~~)( ?)(?!~<)

Change to: 

~|$2 ~|

But I want to change the ( ?) to (\s?) with this escape. What is the easiest way to do this?

This topic has been closed for replies.
Correct answer FRIdNGE

(?!~|)\s

 

(^/)  The Jedi

1 reply

Legend
July 16, 2021

If I am reading your intentions correctly, then you would not need to exclude the hair space from your search.

It would be a little redundant, in that it would replace any hair space it found with a hair space, but your end result would be the same as if you had skipped finding the hair spaces.

EmOlivette
Known Participant
July 16, 2021

The problem is that I'm looking for instances that don't have the hair space as a review stage. I don't want to replace all, I just want to find the examples that don't have it. 

FRIdNGE
FRIdNGECorrect answer
July 16, 2021

(?!~|)\s

 

(^/)  The Jedi