On Wed, Aug 20, 2008 at 3:44 PM, Henry Rich <[EMAIL PROTECTED]> wrote:
> I need the regex command that will change
> Henry Rich xxx
> to
> Rich, Henry xxx
> (each name is terminated by a single space)

   require'regex'
   s=: 'Henry Rich xxx'
   p=: '(\w+) (\w+) (\w+)'
   p rxmatch s
 0 14
 0  5
 6  4
11  3
    p ([EMAIL PROTECTED] rxcut ]) s
++-----+-+----+-+---+
||Henry| |Rich| |xxx|
++-----+-+----+-+---+
    4 0 3 2 5 6 ;@:{ p (','; [EMAIL PROTECTED] rxcut ]) s
Rich, Henry xxx

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

Reply via email to