Re: Regexp help

2013-07-30 Thread Nikolay Pavlov
On Jul 30, 2013 7:26 PM, "Erik Christiansen" wrote: > > On 30.07.13 07:41, Ben Fritz wrote: > > The OP specifically said that valid decimals are "in the form 1.0D0, > > or more precisely \d\+\.\d\+D\d\+" so I didn't try stuff like "123." > > or ".123". > > Wot ... just trust the problem specificat

Re: Regexp help

2013-07-30 Thread Erik Christiansen
On 30.07.13 07:41, Ben Fritz wrote: > The OP specifically said that valid decimals are "in the form 1.0D0, > or more precisely \d\+\.\d\+D\d\+" so I didn't try stuff like "123." > or ".123". Wot ... just trust the problem specification? OK, the OP might be a mathematician or engineer, since fortra

Re: regexp help

2013-07-30 Thread Erik Christiansen
On 30.07.13 10:25, Charles Campbell wrote: > Erik Christiansen wrote: > >123 123.0 123. 456 0.123 .123 789 > Try... > /\<-\=[0-9]\+\ze\_s That fails here, also matching the fractional parts of the non-integers. The tweak of Ben Fritz's regex, on his second thread on this topic, seems to perform be

Re: Regexp help

2013-07-30 Thread Ben Fritz
On Tuesday, July 30, 2013 9:27:51 AM UTC-5, Erik Christiansen wrote: > On 30.07.13 06:57, Ben Fritz wrote: > > > Maybe better using "very magic": > > > > Everything's better with \v ;-) > > Yes. I occasionally edit portions of my .vimrc where I didn't used it, and wonder why. > > > \v<\

Re: Regexp help

2013-07-30 Thread Erik Christiansen
On 30.07.13 06:57, Ben Fritz wrote: > Maybe better using "very magic": Everything's better with \v ;-) > \v<\d+>\.@! On the test line: 123 123.0 123. 456 0.123 .123 789 that regex also detects the fractional parts as integers, so it still needs a tweak. This seems to do it: /\v\.@\.@! But

Re: regexp help

2013-07-30 Thread Charles Campbell
Erik Christiansen wrote: 123 123.0 123. 456 0.123 .123 789 Try... /\<-\=[0-9]\+\ze\_s Regards, Chip Campbell -- -- 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

Re: Regexp help

2013-07-30 Thread Ben Fritz
On Tuesday, July 30, 2013 4:15:37 AM UTC-5, kilter wrote: > 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

Re: regexp help

2013-07-30 Thread kilter
> > 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. > > >

Re: regexp help

2013-07-30 Thread Erik Christiansen
On 30.07.13 10:18, RICHARD PITMAN wrote: > 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.

Re: regexp help

2013-07-30 Thread Marcin Szamotulski
On 11:37 Tue 30 Jul , Davido wrote: > RICHARD PITMAN 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 foll

Re: regexp help

2013-07-30 Thread Davido
RICHARD PITMAN 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

regexp help

2013-07-30 Thread RICHARD PITMAN
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 l

Regexp help

2013-07-30 Thread RICHARD PITMAN
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 re