[Jprogramming] Regex question: rxapply for multiple matches with multiple verbs

Mark Allen allenam at tcd.ie
Thu Jul 15 19:11:39 HKT 2010


Hi,
By following the Regular Expression Studio page (
http://www.jsoftware.com/jwiki/Studio/Regular%20Expressions ), I can easily
enough do something like this:
m =: '(rev[0-9]*).*(rot[0-9]*)'
(m;,1) |. rxapply 'rev3 rot5'
3ver rot5
(m;,2) _2&|. rxapply 'rev3 rot5'
rev3 t5ro
Is there any way in which i can apply the two verbs at once in the same
expression? I would have guessed at something along the lines of
(m;1 2) (|.`_2&|.) rxapply 'rev3 rot5'
however, this throws a domain error. Is there any way to do this in J?
Regards,
Mark


More information about the Programming mailing list

AltStyle によって変換されたページ (->オリジナル) /