I edit in the vi editor. I want to search in the text for a specific phrase, e.g "Dec 1 15:13:00"
. I have tried this search string, but it's not working:
/Dec\ 1\ 15
How do I search for this string properly? Note that there may be more than one space between the parts.
Numbers and spaces are not special characters so
/Dec 1 15
is enough.
Generally speaking special characters are escaped with a \
. For example, if you search for Dec.
, you should type /Dec\.
If you are using Vim, you might also want to check
:help pattern.txt
And specifically the magic
chapter.
If you want to know if magic is set, type :set magic?
The magic option can change the behavior of pattern matching.