Sorry I thought you had compilation issue.

Your question: find all names that are defined but not used.

It is reduced to simple set operation, if you find names that are present, but 
not
definitions.

This might be done with negative lookahead. See PCRE documentation.


Oleg


On Mar 28, 2008, at 17:56, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:

Could you narrow it down to the application of
regex itself, e.g.

 rxcomp_jregex_ :: _1: '[^abc]+|...'

And then verbal formulation what it's expected
to match and a few examples.

It may be just the case of choosing different
matching strategy as Raul said.


--- Brian Schott <[EMAIL PROTECTED]> wrote:

   I want to alter the code below from fiw.ijs so that
I can find the name of a verb, adverb, or conjunction only
if it is NOT being assigned (defined). In other words, in
the cases below in the verb fwssinit , I want names that
match case 1 but do NOT match cases 2, 3, or 4, whereas at
present case 1 does match cases 2, 3, or 4, also. My purpose
is to clean up old code in which I have left in definitions
that are not really used, so I would like to automate the
Find utility by altering it to try to find each name found
in "nl 2 3 4"  against this limited "In context:".

   I am posting in the "general" forum thinking this is
primarily a regex question, but there is clearly a
"programming" aspect.

fwssinit=: 3 : 0

p=. y
nna=. '(^|[^[:alnum:]_])'
nnz=. '($|[^[:alnum:]_])'

select. FIWCONNDX
case. 1 do. p=. nna,p,nnz
case. 2 do. p=. nna,p,'[[:space:]]*=[.:]'
case. 3 do. p=. nna,p,'[[:space:]]*=:'
case. 4 do. p=. nna,p,'[[:space:]]*=\.'
end.

FIWCOMP=: rxcomp_jregex_ :: _1: p

if. FIWCOMP -: _1 do.
 finfo 'Unable to compile regular expression'
 0
else.
 1
end.
)


(B=)

Brian Schott
Atlanta, GA, USA
schott DOT bee are eye eh en AT gee em ae eye el DOT com
http://schott.selfip.net/~brian/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




     
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



      
____________________________________________________________________________________
Special deal for Yahoo! users & friends - No Cost. Get a month of Blockbuster 
Total Access now 
http://tc.deals.yahoo.com/tc/blockbuster/text3.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to