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 Michael Davey - Sun UK Support Engineer <mi...@Sun.COM> on 2002/01/29 17:08:44 UTC

special control characters

[I wasn't sure whether to send this to oro-dev or oro-user.
As it deals with the internals of ORO, I have chosen oro-dev.]


Hi all,

In perl, I can do:

  perl -e '$a="\a\b\e\f\r\t\v\007\x07"; $a =~ s/\b/\t/; die unless $a ==
"\a\t\e\f\r\t\v\a\a"'

In ORO, I would expect to do:

  Perl5Util perl = new Perl5Util();
  result = new StringBuffer();
  input = new PatternMatcherInput ( "\\a\\b\\e\\f\\r\\t\\v\\007\\x07" );
  result = perl.substitute( "s/\\b/\\t/", input);
  assertEquals( "\007\t\033\f\r\t\013\007\007", result.toString() );

...without generating an exception (where assertEquals() compares
two strings and generates an exception if they do not match).

I have skimmed through the source to ORO and searched the archives,
but nothing jumped out at me.

I am thinking that my code doesn't work because:
  o  I am missing something (most likely)
  o  the design of substitute() is different to what I expect
  o  this is a limitation of substitute() in the current version of ORO
  o  ORO delegates escaping of control characters to Java, which is
rather limited in those it will accept

Any pointers would be most welcome.


Cheers,
-- 
Michael

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>