How to search for spaces? #2042
-
Sorry for this rudimentary question, but I am wondering if this is correct to search for rg 'some pattern' because my instinct was to escape the space, like this rg 'some\ pattern' which results in
similarly, how to search for a line ending with 2 spaces? rg ' $' not? rg '\ \ $' any way to invoke |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Why are you trying to escape spaces? Literal spaces work just fine. What isn't working about them?
POSIX support is a non-goal. If you want POSIX then use POSIX compatible tooling. |
Beta Was this translation helpful? Give feedback.
-
Ok @BurntSushi thank you. Makes sense. Sorry for the uninformed question. I guess I picked up a habit of escaping spaces somewhere along my way, maybe when working with unquoted strings ... |
Beta Was this translation helpful? Give feedback.
-
I have a similar issue. Searching for I'd like to search w/o any regexp-syntax completely. But I fail to see there is one. |
Beta Was this translation helpful? Give feedback.
-
@gvanem You can use either of these...
or
|
Beta Was this translation helpful? Give feedback.
Why are you trying to escape spaces? Literal spaces work just fine. What isn't working about them?
POSIX support is a non-goal. If you want POSIX then use POSIX compatible tooling.