You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by Mike Laskin <ML...@digitalimpact.com> on 2002/04/08 19:11:10 UTC
Plus (+) in PerlUtil.match [] regexps
Hi,
I am having some trouble finding a matching string for the following unix
command.
perl -e 'while (<>) {if (/([ A-Za-z0-9;\/?:@
<mailto:A-Za-z0-9;\/?:@&=$,\-_.!~*\+()%#|\x2b> &=$,\-_.!~*\+()%#|\x2b]+)/)
{print;}}'
This will accept input like
a+b
+
b+
and not
<
>
etc.
The corresponding Java version I have is:
if ( perlUtil.match("/([ <mailto:A-Za-z0-9;\\/?:@&=$,\\-_.!~*>
A-Za-z0-9;\\/?:@&=$,\\-_.!~*\\+()%#|\\x2b]+)/", postMatch) )
and this does not accept any of the strings above
I am guessing that I am not escaping the + properly in the Java version --
Would anyone have any recommendations on other ways? As you can see I have
tried the hex \\x2b <file://\\x2b> and that did not seem to help.
BTW: I am using ORO 2.0.2
Thanks,
Mike