Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-17 Thread Jon Hough
oftware.com > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Regex vs I./E. for pattern matching > > note that there is an even faster version > > 10 timespacex '( I. ''CTAG'' E. DNA)' > 2.656e_6 6016 > 10 timespacex 

Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-16 Thread 'Pascal Jasmin' via Programming
note that there is an even faster version 10 timespacex '( I. ''CTAG'' E. DNA)' 2.656e_6 6016 10 timespacex '( ''CTAG'' I.@:E. DNA)' 2.144e_6 6400 for Henry's example of 'CTAG*ACTA' there can be some enhanced flexibility for using E. ('CTAG';'ACTA') I.@:E.each < DNA one way to use t

Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-16 Thread Henry Rich
If you something more than a simple match, say CTAG*ATTA, regex will be easier and probably faster. As I understand, regex builds a state machine for your pattern and then executes it. Do note that you can separate the building of the machine from the execution by using rxcomp: pat =. rxcom

Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-16 Thread Raul Miller
Yes? E. is faster than rxmatches precisely because it is less powerful. And note that you could also use ;: (but the trace operation is 5x larger than you need and most people don't like making state machines). -- Raul On Sun, Aug 16, 2015 at 2:09 AM, Jon Hough wrote: > I recently went throu

Re: [Jprogramming] Regex vs I./E. for pattern matching

2015-08-16 Thread Linda Alvord
Sorry I don't know regex, but I like to solve problems in simple J. So here' are some steps to answer your problem. There are lots of ways to condense this and many ways to present your result. However, answering the question itself always seems like a start to me. DNA=: 'CGATTGACTAGTCGATTGCTG