• Post Reply Bookmark Topic Watch Topic
  • New Topic

RE's - Java vs. Everything else  RSS feed

 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't remember exactly what I was working on at the time but I seem to remember a regular expression I had written in Perl. I decided to try what I was doing in Java and the RE that had worked in Perl didn't work correctly in Java's RE. I think I was parsing HTML but am not sure.
Anyway, are there any "gotcha's" or things to keep in mind when doing RE in Java? Does Java handle RE's differently than other languages? Should all RE's that work inside other languages work with Java RE's? And does your book talk about these things?
[ April 13, 2004: Message edited by: Gregg Bolinger ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some differences between regular expressions in Perl and regular expressions in Java 1.4.
Max does include descriptions of these distinctions throughout the book.
Concerning the differences and handling them, let me quote part of a sentence from the book.
...J2SE doesn't include some Perl constructs, because Java is a full-featured programming language that offers sophisticated condition and logical paths of execution that are reasonable alternatives to the constructs offered by Perl.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!