Pattern.matcher

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Revenge

    #1

    Pattern.matcher

    Hi all,
    I have a problem with the Pattern.matcher method.
    When I try to find a string with a regular expression, sometimes it throws
    an error as:
    "Illegal repetition near index 18" or "Unclosed counted closure near index
    35"

    I think that this error appears when the matcher finds a string containing
    some escape chars such as $ or ! or { and }.

    Example:
    String a = "<tagname attribute=\"{$v ar}\" />" //(this string in my program
    is read froma file)
    ....
    ....
    Matcher matcher = Pattern.matcher (a); //here throws the error

    Could you help me?

    Thanks in advance,
    Revenge


Working...