Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I got some logs from a windows machine, which contains multiple instances of <200e>, I know it's a unicode char, but how can I remove it with s command?

I don't know how to input that in the command "line".

EDIT

This is a unicode char, which means I can delete that with single x key pressing .. it's not 6 chars <200e> ...

share|improve this question
    
have you check this post ? stackoverflow.com/questions/8562354/… –  Rahul Patil Dec 26 '12 at 4:26
add comment

1 Answer

up vote 6 down vote accepted

From :help i_CTRL-V_digit:

With CTRL-V the decimal, octal or hexadecimal value of a character can be entered directly. This way you can enter any character, except a line break (, value 10). There are five ways to enter the character value:

first char  mode         max nr of chars   max value
( none )    decimal        3               255
o or O      octal          3               377      (255)
x or X      hexadecimal    2               ff       (255)
u           hexadecimal    4               ffff     (65535)
U           hexadecimal    8               7fffffff (2147483647)

This means you can use <Ctrl-v>u200e to input the character and use it as usual in substitute commands or elsewhere.

:%s/<Ctrl-v>u200e//g
share|improve this answer
1  
There is also a regexp-specific way to denote extended characters, see :help /\%u (this lets you type without having to use C-v, i.e. it is easy to “paste”): %s/\%u200e//g –  Chris Johnsen Dec 27 '12 at 6:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.