This was my first time to encouter this kind of exception....
that exception appears when i invoked the the method below.
- private final String encrypting(String enc){
-
int declen=array1.length;
-
String temp=enc;
-
for(int x=-1;x++<declen;){
-
temp=temp.replaceAll(String.valueOf(array2[x]),String
-
.valueOf(array1[x]));
-
}
-
return temp;
-
}
array1 contains a character ' * ' or a multiply operator in java.
@ runtime, it throws java.util.regex.PatternSyntaxException
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.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(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