Really?

Does it behave differently in Perl?

It looks like non-overlapping makes more sense.
Suppose you tokenize a string, if overlapping is allowed than
the same character would occur in multiple tokens, which is unusual at best.


On Jan 14, 2010, at 2:49 PM, Raul Miller <[email protected]> wrote:

  9!:14''
j602/2008-03-03/16:45

rxmatches does not provide all matches.

 require'regex'
  '(1x)|(_1)' rxmatches '_1x'
0 2
_1 0
0 2
  '(1x)' rxmatches '_1x'
1 2
1 2

If matches would overlap, some of them are not considered.

This nonoverlapping behavior might be desirable in
some cases but winds up being a problem in other
cases. (Specifically, this breaks an implementation
of http://rosettacode.org/wiki/Markov_Algorithm)

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



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

Reply via email to