This was my first time to encouter this kind of exception....
that exception appears when i invoked the the method below.
[CODE=JAVA]private final String encrypting(Stri ng enc){
int declen=array1.l ength;
String temp=enc;
for(int x=-1;x++<declen;){
temp=temp.repla ceAll(String.va lueOf(array2[x]),String
.valueOf(array1[x]));
}
return temp;
}[/CODE]
array1 contains a character ' * ' or a multiply operator in java.
@ runtime, it throws java.util.regex .PatternSyntaxE xception
same as array2, but another array of characters.
Dangling meta character ' * ' near index 0 *
@at java.util.regex .Pattern.error( Unknown Source)
at java.util.regex .Pattern.sequen ce(Unknown Source)
at java.util.regex .Pattern.expr(U nknown Source)
at java.util.regex .Pattern.compil e(Unknown Source)
How can i reproduce this method? I don't have any idea how to set the asterisk to be treaten as ordinary character since it has special meanings according to this article....
looking forward for your replies,
sukatoa
that exception appears when i invoked the the method below.
[CODE=JAVA]private final String encrypting(Stri ng enc){
int declen=array1.l ength;
String temp=enc;
for(int x=-1;x++<declen;){
temp=temp.repla ceAll(String.va lueOf(array2[x]),String
.valueOf(array1[x]));
}
return temp;
}[/CODE]
array1 contains a character ' * ' or a multiply operator in java.
@ runtime, it throws java.util.regex .PatternSyntaxE xception
same as array2, but another array of characters.
Dangling meta character ' * ' near index 0 *
@at java.util.regex .Pattern.error( Unknown Source)
at java.util.regex .Pattern.sequen ce(Unknown Source)
at java.util.regex .Pattern.expr(U nknown Source)
at java.util.regex .Pattern.compil e(Unknown Source)
How can i reproduce this method? I don't have any idea how to set the asterisk to be treaten as ordinary character since it has special meanings according to this article....
looking forward for your replies,
sukatoa
Comment