I want to do 
"s/^let (\w+) = /\t276\t\1\t/"

but j regex (pcre) rxrplc does not product correct result. It seems
cannot understand \ in the substitution part. replace \t by actual
value of TAB only solves part of the problem, the backreference \1
does not take any effect and is regarded as literal '\1'.  What is the
correct way to do it?

require 'regex'

('^let (\w+) = ';'\t276\t\1\t') rxrplc 'craction 2',LF,'let A0 = 123',LF

('^let (\w+) = ';TAB,'276',TAB,'\1',TAB) rxrplc 'craction 2',LF,'let A0 = 
123',LF

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to