• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Simplest way to say search all spaces, except hair space

Explorer ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

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?

TOPICS
How to

Views

122

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jul 16, 2021 Jul 16, 2021

(?!~|)\s

 

(^/)  The Jedi

Votes

Translate

Translate
Community Expert ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

(?!~|)\s

 

(^/)  The Jedi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

LATEST

Added a ? to check for one or more, and it works! Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines