--- Raul Miller <[EMAIL PROTECTED]> wrote:

> If I wanted to do lexical analysis in this context (and
> I'm not sure why I would), here's a ;: verb which would
> serve:
> 
>    lexi=:(0;(0 10#:0 100#:1121 1022 1220);a.e.'-: ');:]
> 
> This breaks the input into a sequence of lexical tokens.
> 
> If I wanted the result given by the above rxscan expression
> for the given input, here's a ;: verb which would serve:
> 
>    split=: (0;(0 10#:0 100#:1100 1003);a.e.'-: ');:]
> 
> Of course, neither of the above is an exact work-alike for
>    '(....)-(..)-(..) (..):(..):(..)' <rxscan input [ require 'regex'

  rxscan=: 1 : ',."1@(}."2)@rxmatches u;.0 ]'

Note: rxscan is not part of regex now, but probably should

As for the ;: dyad, the one-liners are impressive
and the brief summary of ;: dyad codes make it more accessible.

However, will it distinguish between .... and .. ?
Will it consume just the pair of triples or will
return whatever assortment of ' -:' separated numbers?
Which would be the same as simple ;: after
replacing ':-' with ' '.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to