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
@:E.each) < DNA
----- Original Message -
From: Jon Hough
To: "programm...@jsoftware.com"
Cc:
Sent: Sunday, August 16, 2015 2:09 AM
Subject: [Jprogramming] Regex vs I./E. for pattern matching
I recently went through the regex lab, and would like to know whether it is
more idiomatic for
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
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
to:programming-boun...@forums.jsoftware.com] On Behalf Of Jon Hough
Sent: Sunday, August 16, 2015 2:10 AM
To: programm...@jsoftware.com
Subject: [Jprogramming] Regex vs I./E. for pattern matching
I recently went through the regex lab, and would like to know whether it is
more idiomatic for J users
I recently went through the regex lab, and would like to know whether it is
more idiomatic for J users to use regex when matching simple patterns in a
string, or to use E. and similar verbs?
For example. If I have an (imaginary) DNA sequence string:
DNA=:
'CGATTGACTAGTCGATTGCTGATGCTCTAGTCGTGATGC