consiglieri wrote:
Hi

I have not previously used Macvim for regexp searching (only BBedit).
I can't seem to understand how to enter the regexp.

I want to use the following regexp

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b

when I try it in vim I never get any hits.

I guess I'm doing something wrong when entering it.
I would be very grateful if someone could show me how i enter it?
Is it :s/ or is it just / or what?
OK, let's see what your regexp is matching using the help.

\b : :he /\b shows that this matches a backspace character (is that what you want?)

[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z] : quite a range you have here with a lot of repeated character ranges. For example, the +-] matches a range of characters with integer values of 43 through and including 93. See :help [ and read about - near line 996 (with vim7.3).

{2,4} matches, literally the characters { 2 , 4 } . If you happened to want 2-4 matches of the preceding atom, see :help /\{

\b : again, you're asking for a match to the backspace character (ascii #8). Did you happen, perhaps, to want to match to a whitespace? See :he /\s .

I suggest reading, or at least glancing through, :help regexp ; Vim's regular expressions are not the same as BBedit's, evidently.

Regards,
Chip Campbell

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to