Tuesday, July 30, 2013

Re: regexp help

On 11:37 Tue 30 Jul , Davido wrote:
> RICHARD PITMAN <richard.pitman3@btopenworld.com> wrote, on mar 30 jui 10:18 :
>
> > Apologies if this is a re-post, I think the first went to the wrong address...
> >
> > I have a fortran program in which there are two sorts of numbers,
> > integers which are simply digits not followed by a period, and double
> > precision numbers in the form 1.0D0, or more precisely \d\+\.\d\+D\d\+ I would like to search for the former, avoiding the latter.
> >
> >
> > Any
> > suggestions gratefully received!
> >
>
> The Boolpat plugin can combine patterns with logical operator
> (and/or/not), it may help you :
>
> http://www.vim.org/scripts/script.php?script_id=3850
>
> --
> Regards,
>
> Davido
>
> --
> --
> You received this message from the "vim_use" 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

You can try something like this, though it is not perfect (since it
matches every digit separately):

\d\+\&\(\d\+\.\d\+D\d\+\)\@!\&\(\d\+D\)\@!\&\(\d\+\.\d\+D\d*\)\@<!

Regards,
Marcin

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment