I think this is a bug as illustrated by your example. 
The fix will be in the next base library release. Thanks for
reporting with a clear example.

   ('^B';'C') rxrplc 'BBB my sentence'
CBB my sentence
   ('B';'C') rxrplc 'BBB my sentence'
CCC my sentence
 
Пт, 11 дек 2015, Ryan Eckbo написал(а):
> Ok I see. Unfortunately rxrplc uses rxmatches, so it was messing me up when
> I was trying to
> replace just the first character:
> 
> ('^B';'C') rxrplc 'BBB my sentence'
> CCC my sentence
> 
> 
> On 11 Dec 2015, at 2:52, Alex Shroyer wrote:
> 
> >If you just want the *first* match, use *rxmatch*.  Use *rxmatches* in
> >when
> >you want to keep doing *rxmatch* on the rest of the string after finding a
> >match, until the end of the string.
> >
> >
> >On Thu, Dec 10, 2015 at 6:33 AM, bill lam <bbill....@gmail.com> wrote:
> >
> >>I think this is the way that rxmatches works, it iterates by
> >>beheading the right argument so that ^B match 3 times.
> >>Not sure this is a bug or a feature.
> >>
> >>Чт, 10 дек 2015, Ryan Eckbo написал(а):
> >>>I believe there should only be one match.  Why are there 3?
> >>>
> >>>load'regex'
> >>>'^B' rxmatches 'BBB my sentence'
> >>>0 1
> >>>
> >>>1 1
> >>>
> >>>2 1
> >>>
> >>>----------------------------------------------------------------------
> >>>For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >>--
> >>regards,
> >>====================================================
> >>GPG key 1024D/4434BAB3 2008-08-24
> >>gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> >>gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> >>----------------------------------------------------------------------
> >>For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >----------------------------------------------------------------------
> >For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to