This PR makes a few changes to the Java example for better practices. (If this goes into the PayPal codebase, they'll want good coding practices 😉 )
Uses try-with-resources to ensure the file reader is closed under all circumstances
Compiles the regex only once and re-uses it since it doesn't change
Uses Java 8 stream on BufferedReader for more streamlined code
Removes capture group from regex. Does not affect functionality of |s (try it)
How to use:
Copy invoices.txt to project root (java folder)
With Maven installed, run the command mvn package from the project root
Run java -jar target/FixPaypalRegex-1.0-SNAPSHOT.jar
This PR makes a few changes to the Java example for better practices. (If this goes into the PayPal codebase, they'll want good coding practices 😉 )
|
s (try it)How to use:
invoices.txt
to project root (java
folder)mvn package
from the project rootjava -jar target/FixPaypalRegex-1.0-SNAPSHOT.jar