Thank you to Raul and Oleg.

        I employed Oleg's idea and because the result is
just a starting place for me to look more closely at the
results, I did not need to refine the search much to get a
useful result. I will show an excerpt of my saved session
below. I guess I am not too surprised I found so much "dead
wood" in my script with this approach.

On Fri, 28 Mar 2008, Oleg Kobchenko wrote:

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


NB. finddeadwood.ijs
NB. 3/29/8

NB. verb "search" below finds dead wood in a script
NB. used Oleg's hint: negative lookahead. See PCRE documentation.
NB. see "after" below for "(?!...)"

require 'files regex'

NB. the file must be both read and loaded
a =: fread jpath'~user/addons/turtle/tgsj3ogl.ijs'
load jpath'~user/addons/turtle/tgsj3ogl.ijs'

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

after =: nnz,'(?![[:space:]]*=[.:])'
search =: [{.~_*(nna,after,~[)(0&>)@[EMAIL PROTECTED]@rxmatch]

NB. b/c the script is in bmsturtle3 locale, it must be specified
(#~a:~:])(nl_bmsturtle3_ 1 2 3) search each <a

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to