You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by "Mike T. Miller" <mt...@csoft.net> on 2001/03/09 00:27:32 UTC
change to 'subst'
I'd like to add "subgroup" awareness to 'subst' so that things like
RE re = new RE("(xyz)");
System.out.println(re.subst("abcxyzabc", "-\\1-"));
will produce "abc-xyz-abc".
This wouldn't take me much to put in. Is there any objections?
(Maybe the subgroup character should be '$' instead of '\'? I've
seen it both ways.)
Mike
Re: change to 'subst'
Posted by Michael McCallum <gh...@xtra.co.nz>.
On Friday 09 March 2001 06:41, you wrote:
} Mike T. Miller <mt...@csoft.net> wrote:
}
} > (Maybe the subgroup character should be '$' instead of '\'? I've
} > seen it both ways.)
}
} $ is Perl's way while most other regexp supporting tools (grep, sed,
} emacs for example) use \ . I'd prefer \.
Me too.
Michael
Re: change to 'subst'
Posted by Stefan Bodewig <bo...@bost.de>.
Mike T. Miller <mt...@csoft.net> wrote:
> (Maybe the subgroup character should be '$' instead of '\'? I've
> seen it both ways.)
$ is Perl's way while most other regexp supporting tools (grep, sed,
emacs for example) use \ . I'd prefer \.
Stefan