• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pattern Syntax Exception

 
Abhi vijay
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


In this example when will a Pattern Syntax Exception thrown?
 
Ruben Soto
Ranch Hand
Posts: 1032
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abhi,

Your example won't throw a PatternSyntaxException. That's thrown by compile, when you give bad syntax for the regex. For example, try deleting the period (.) and run your program again.
 
Abhi vijay
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Ruben.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic