How to search a string having spaces, slashes, colons in vi editor
I need to seach a string containing
the substring of 'New Request object:' and the substring of '/0x2ab46b1f90' in vi editor, how do I accomplish that? thanks. |
Vi's search string is a simplified regex parser so you simply need to escape any regex special characters which in your case is only the /.
Regards, Alunduil |
do I need to put quotes around the search string?
in vi, do I type /New*Request*object:*0x2ab46b1f90 or /'New Request object:'+'0x2ab46b1f90' |
It would simply be /New Request object: for the first string. If you want both you'll need to use the regexp or operator: '|'. Try the following: /(item1|item2)
Although, I'm not sure if that will work as I've never encountered a time when I needed to search for multiple things I couldn't do with grep. Regards, Alunduil |
Quote:
Code:
/New Request object:/;/\/0x2ab46b1f90 |
Quote:
New Request object: and /0x2ab46b1f90, how do I do that? thanks |
Quote:
Code:
/New Request object:.*\/0x2ab46b1f90 |
This command should do the trick:
Quote:
|
All times are GMT -5. The time now is 05:22 AM. |