searching with 'find & 'regex
Posted: Tue Jun 27, 2006 7:26 pm
Hi lutz,
I was thinking why my update.lsp was not working this week and i found
that a normal regex does not perform a search until the end of the document.
So it always stops at the first match. For update.lsp that is
logical because currently there are 2x newlisp-xxxx-win-tk-xxx.exe files
in the the upload directory, and its sorted ;-) So i tried to fix the problem,
I can tell you.. I ended upsidedown reading the pcre document and remembered why i stopped using Perl in 1996..
Is there a way to build inside newLisp a context or a function
that is pure newlisp. That means no involvement of regex/pcre
output or input at all?
I would love to be able to build my own seek/search functions with
the use of 100% pure newlisp but im unable to comply to that now,
there are simple not enough index-based functions in newlisp that
dont use regex..
Lets assume I wanted to remove PCRE lib complete from my newlisp
binary..(its saves not a lot, but it saves bytes).. What would be the
alternatives to search inside strings or loaded documents?
replace does the replace
Index should be able to count my position
but then... ?? what function to use that replaces 'find/regex ?
Oke I could do a trick to reroute the IO and use 'search on the current
device, but thats too compilcated..
What about the older 'search functions from the previous newlisp
releases? You removed those, but is it an option to put them back in
and enhance that? (I dont care about milliseconds of speed I actualy
care more about pure newlisp routines functions ;-)
Hope you have an idea.. regards, Norman.
I was thinking why my update.lsp was not working this week and i found
that a normal regex does not perform a search until the end of the document.
So it always stops at the first match. For update.lsp that is
logical because currently there are 2x newlisp-xxxx-win-tk-xxx.exe files
in the the upload directory, and its sorted ;-) So i tried to fix the problem,
I can tell you.. I ended upsidedown reading the pcre document and remembered why i stopped using Perl in 1996..
Is there a way to build inside newLisp a context or a function
that is pure newlisp. That means no involvement of regex/pcre
output or input at all?
I would love to be able to build my own seek/search functions with
the use of 100% pure newlisp but im unable to comply to that now,
there are simple not enough index-based functions in newlisp that
dont use regex..
Lets assume I wanted to remove PCRE lib complete from my newlisp
binary..(its saves not a lot, but it saves bytes).. What would be the
alternatives to search inside strings or loaded documents?
replace does the replace
Index should be able to count my position
but then... ?? what function to use that replaces 'find/regex ?
Oke I could do a trick to reroute the IO and use 'search on the current
device, but thats too compilcated..
What about the older 'search functions from the previous newlisp
releases? You removed those, but is it an option to put them back in
and enhance that? (I dont care about milliseconds of speed I actualy
care more about pure newlisp routines functions ;-)
Hope you have an idea.. regards, Norman.