aspose file tools*
The moose likes Beginning Java and the fly likes different behavior with regex on linux vs windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "different behavior with regex on linux vs windows" Watch "different behavior with regex on linux vs windows" New topic
Author

different behavior with regex on linux vs windows

Ben David
Ranch Hand

Joined: Oct 01, 2010
Posts: 67
I am getting different behavior with regex matching using java.util.regex.Matcher depending on if it is run on windows or linux. Anybody know why this might be?

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

Are you using any line breaks in your regex? Or is your regex depending on line breaks in the input?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ben David
Ranch Hand

Joined: Oct 01, 2010
Posts: 67
nevermind! On windows I was running within eclipse. In linux I was running bins from a jar. I had renamed an old version of the jar, and didnt realize it would still look in this jar in the lib folder even though it had a different name. And this other jar file also had an xml conf file (by accident). On linux, it was apparently finding the conf file in this renamed jar and so it never looked in the "conf" folder for the most recent xml file.

Newb mistake.


 
Consider Paul's rocket mass heater.
 
subject: different behavior with regex on linux vs windows