You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by Andres Dominguez Burgos <An...@landc.be> on 2003/07/03 15:46:00 UTC

substitution

Hello.
How do you substitute if you have /b[a]b/ and you want [bbb]?
This does not seem to work:
        String patt = " [.,]";

        Perl5Matcher patternMatcher;
        Perl5Compiler compiler = new Perl5Compiler();
        patternMatcher  = new Perl5Matcher();
        try {
        Perl5Pattern pattern = (Perl5Pattern) compiler.compile(patt);

        Perl5Substitution subs = new Perl5Substitution("[.,]");
        return Util.substitute(patternMatcher,pattern,subs,inputS,Util.SUBSTITUTE_ALL);
        } catch(Exception e){
            e.printStackTrace();
    }
Thanks,
A

---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org


Re: substitution

Posted by "Mark F. Murphy" <ma...@tyrell.com>.
At 3:46 PM +0200 7/3/03, Andres Dominguez Burgos wrote:
>Hello.
>How do you substitute if you have /b[a]b/ and you want [bbb]?

I'm not sure I understand what you're trying to do.

What is your original example string to replace and what do you want 
it to end up looking like?

mark

-- 
---------------------------------------------------------------------------
  Mark F. Murphy, Director Software Development   <ma...@tyrell.com>
  Tyrell Software Corp                            <http://www.tyrell.com>
---------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org