Copy link to clipboard
Copied
Copy link to clipboard
Copied
It works fine for me
Don't know why it's so complicated - you could search for a single space (inserted by space bar) and it finds the same thing.
Can you elaborate or provide a larger sample set?
Copy link to clipboard
Copied
What exactly are you trying to achieve?
Remove those spaces? All of them or some?
Replace them with something else?
Remove whole line?
Copy link to clipboard
Copied
To avvoid lines that start with three spaces, look for
^[^\h][^\h][^\h]
Copy link to clipboard
Copied
^\S{3}
(^/) The Jedi
Copy link to clipboard
Copied
I would like to use a forward and reverse check(? = or ? <!) to realize it。
Well, a different example might make more sense.
I'm trying to find and replace a space.
Except for spaces after numbers, except for consecutive spaces at the beginning of a paragraph.
I just realized that I can't replace spaces in (? <! [\d])(\h) expression, then add the condition.
(? <! [\d\h])(\h).
That is to say: (? <! [\h])(\h) may be meaningless.
Copy link to clipboard
Copied
If you add "^" at the beginning of your GREP expression - it will find only paragraphs starting with your search phrase - as per examples from @Peter Kahrel and @FRIdNGE.
Copy link to clipboard
Copied
You write:
"I'm trying to find and replace a space."
What space in your sample?
Apparently, you want to find a space not preceded by a number or another space, the "3 spaces" case being not taken in account. Right?
(^/)
Between, "(?<![\d\h])" won't never work because it's a Grep incorrect syntax.
Copy link to clipboard
Copied
Theoretically there is no problem.
In practice:(? <! \h)([a-z]) is established
But (? <! \h)(\h) does not hold.