🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.tpu
Article #99

Pattern

#99
From: Mirko Vukovic
Date: Wed, 30 Dec 1992 18:40
40 lines
1555 bytes
Hello!

I am converting a fortran code from single to double precision on a VAX.  I 
a TPU routine that searches for constants in the program by using the following
patterns

	aaaa.bbbbbX
	    .bbbbbX
	aaaa.X

	aaaa any number of digits
	bbbb any number of digits
	X any character except d,D

and puts the cursor on the end of a line where the pattern was found.

I came up with the following patterns:

predig:=span('0123456789');			<--- for aaaa
posdig:=anchor&span('0123456789');		<--- for bbbb
per:='.';					<--- for .
exp:=anchor&(notany('dD')|line_end);		<--- for X

find :=((predig&per&exp)|(per&posdig&exp)|(predig&per&posdig&exp));

However the above does detect numbers like 123.12D00, ie if I have more than one
digit after the period followed by D.

Is that because in posdig anchor forces the span to match only one character?
How do I go around that?  The program has 10000 (10^4) lines.


Also, how do I put a cursor on the end of a range?

Thanks.
-- 
Mirko Vukovic 
University of Wisconsin -- Madison
VUKOVIC@UWMFE.NEEP.WISC.EDU 
Technical Details
Message-ID: <1hsqeoINNmqe@usenet.INS.CWRU.Edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!at913

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!at913
From: at913@cleveland.Freenet.Edu (Mirko Vukovic)
Newsgroups: vmsnet.tpu
Subject: Pattern
Date: 30 Dec 1992 18:40:24 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Lines: 40
Message-ID: <1hsqeoINNmqe@usenet.INS.CWRU.Edu>
Reply-To: at913@cleveland.Freenet.Edu (Mirko Vukovic)
NNTP-Posting-Host: hela.ins.cwru.edu