Newbee needs help
"Rupinder Singh Mazara" <[email protected]> Mon, 22 Jul 2002 14:45:31 +0100
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all
I am a new user to ORO and need some help
I would like to execute the following perl code in java
$pages = Âsomething ;
if ($pages =~ /^(\d+)-(\d+)/){
($p1,$p2) = ($1,$2);
} elsif ($pages =~ /^(\d+)$/){
($p1) = $1;
} elsif ($pages =~ /^([A-Za-z]+)(\d+)$/){
($prefix,$p1) = ($1,$2);
} elsif ($pages =~ /^([A-Za-z]+)(\d+)-(\d+)$/){
($prefix,$p1,$p2) = ($1,$2,$3);
} elsif ($pages =~ /^([A-Za-z]+)(\d+)-(\1)(\d+)$/){
($prefix,$p1,$p2) = ($1,$2,$4);
} elsif ($pages =~ /^(\d+)([A-Za-z]+)-(\d+)(\2)$/){
($p1,$suffix,$p2) = ($1,$2,$3);
} elsif ($pages =~ /^(\d+)([A-Za-z]+)$/){
($p1,$suffix) = ($1,$2);
} else {
warn "Cant parse pages '$pages'";
}
What would be the best way to solve this ? :-(
I was considering using Perl4Util Â
but donot know how to access ($1,$2)
Rupinder